Changeset 328 for pyyaml/trunk/lib/yaml
- Timestamp:
- 12/29/08 12:24:05 (3 years ago)
- Location:
- pyyaml/trunk/lib/yaml
- Files:
-
- 1 removed
- 4 modified
-
cyaml.py (deleted)
-
emitter.py (modified) (4 diffs)
-
representer.py (modified) (1 diff)
-
resolver.py (modified) (2 diffs)
-
scanner.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/emitter.py
r313 r328 546 546 % (handle.encode('utf-8'))) 547 547 for ch in handle[1:-1]: 548 if not (u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\548 if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 549 549 or ch in u'-_'): 550 550 raise EmitterError("invalid character %r in the tag handle: %r" … … 561 561 while end < len(prefix): 562 562 ch = prefix[end] 563 if u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\563 if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 564 564 or ch in u'-;/?!:@&=+$,_.~*\'()[]': 565 565 end += 1 … … 591 591 while end < len(suffix): 592 592 ch = suffix[end] 593 if u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\593 if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 594 594 or ch in u'-;/?:@&=+$,_.~*\'()[]' \ 595 595 or (ch == u'!' and handle != u'!'): … … 614 614 raise EmitterError("anchor must not be empty") 615 615 for ch in anchor: 616 if not (u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\616 if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 617 617 or ch in u'-_'): 618 618 raise EmitterError("invalid character %r in the anchor: %r" -
pyyaml/trunk/lib/yaml/representer.py
r248 r328 287 287 SafeRepresenter.add_representer(datetime.date, 288 288 SafeRepresenter.represent_date) 289 289 290 SafeRepresenter.add_representer(datetime.datetime, 290 291 SafeRepresenter.represent_datetime) -
pyyaml/trunk/lib/yaml/resolver.py
r260 r328 193 193 u'tag:yaml.org,2002:merge', 194 194 re.compile(ur'^(?:<<)$'), 195 [ '<'])195 [u'<']) 196 196 197 197 Resolver.add_implicit_resolver( … … 214 214 u'tag:yaml.org,2002:value', 215 215 re.compile(ur'^(?:=)$'), 216 [ '='])216 [u'=']) 217 217 218 218 # The following resolver is only for documentation purposes. It cannot work -
pyyaml/trunk/lib/yaml/scanner.py
r222 r328 808 808 length = 0 809 809 ch = self.peek(length) 810 while u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\810 while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 811 811 or ch in u'-_': 812 812 length += 1 … … 847 847 # See the specification for details. 848 848 ch = self.peek() 849 if not (u'0' <= ch <= '9'):849 if not (u'0' <= ch <= u'9'): 850 850 raise ScannerError("while scanning a directive", start_mark, 851 851 "expected a digit, but found %r" % ch.encode('utf-8'), … … 913 913 start_mark = self.get_mark() 914 914 indicator = self.peek() 915 if indicator == '*':915 if indicator == u'*': 916 916 name = 'alias' 917 917 else: … … 920 920 length = 0 921 921 ch = self.peek(length) 922 while u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\922 while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 923 923 or ch in u'-_': 924 924 length += 1 … … 1369 1369 ch = self.peek(length) 1370 1370 if ch != u' ': 1371 while u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\1371 while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 1372 1372 or ch in u'-_': 1373 1373 length += 1 … … 1389 1389 length = 0 1390 1390 ch = self.peek(length) 1391 while u'0' <= ch <= u'9' or u'A' <= ch <= 'Z' or u'a' <= ch <= 'z'\1391 while u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z' \ 1392 1392 or ch in u'-;/?:@&=+$,_.!~*\'()[]%': 1393 1393 if ch == u'%':
