Changeset 51 for branches/pyyaml3000/lib/yaml/tokens.py
- Timestamp:
- 02/19/06 17:17:28 (7 years ago)
- File:
-
- 1 edited
-
branches/pyyaml3000/lib/yaml/tokens.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pyyaml3000/lib/yaml/tokens.py
r48 r51 4 4 self.start_marker = start_marker 5 5 self.end_marker = end_marker 6 def __repr__(self): 7 attributes = [key for key in self.__dict__ 8 if not key.endswith('_marker')] 9 attributes.sort() 10 arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) 11 for key in attributes]) 12 return '%s(%s)' % (self.__class__.__name__, arguments) 13 14 #class BOMToken(Token): 15 # id = '<byte order mark>' 6 16 7 17 class DirectiveToken(Token): 8 code= '<directive>'18 id = '<directive>' 9 19 def __init__(self, name, value, start_marker, end_marker): 10 20 self.name = name … … 14 24 15 25 class DocumentStartToken(Token): 16 code= '<document start>'26 id = '<document start>' 17 27 18 28 class DocumentEndToken(Token): 19 code= '<document end>'29 id = '<document end>' 20 30 21 31 class StreamEndToken(Token): 22 code= '<stream end>'32 id = '<stream end>' 23 33 24 34 class BlockSequenceStartToken(Token): 25 code= '<block sequence start>'35 id = '<block sequence start>' 26 36 27 37 class BlockMappingStartToken(Token): 28 code= '<block mapping end>'38 id = '<block mapping end>' 29 39 30 40 class BlockEndToken(Token): 31 code= '<block end>'41 id = '<block end>' 32 42 33 43 class FlowSequenceStartToken(Token): 34 code= '['44 id = '[' 35 45 36 46 class FlowMappingStartToken(Token): 37 code= '{'47 id = '{' 38 48 39 49 class FlowSequenceEndToken(Token): 40 code= ']'50 id = ']' 41 51 42 52 class FlowMappingEndToken(Token): 43 code= '}'53 id = '}' 44 54 45 55 class KeyToken(Token): 46 code= '?'56 id = '?' 47 57 48 58 class ValueToken(Token): 49 code= ':'59 id = ':' 50 60 51 class EntryToken(Token): 52 code = '- or ,' 61 class BlockEntryToken(Token): 62 id = '-' 63 64 class FlowEntryToken(Token): 65 id = ',' 53 66 54 67 class AliasToken(Token): 55 code= '<alias>'68 id = '<alias>' 56 69 def __init__(self, value, start_marker, end_marker): 57 70 self.value = value … … 60 73 61 74 class AnchorToken(Token): 62 code= '<anchor>'75 id = '<anchor>' 63 76 def __init__(self, value, start_marker, end_marker): 64 77 self.value = value … … 67 80 68 81 class TagToken(Token): 69 code= '<tag>'82 id = '<tag>' 70 83 def __init__(self, value, start_marker, end_marker): 71 84 self.value = value … … 74 87 75 88 class ScalarToken(Token): 76 code= '<scalar>'89 id = '<scalar>' 77 90 def __init__(self, value, plain, start_marker, end_marker): 78 91 self.value = value
Note: See TracChangeset
for help on using the changeset viewer.
