Ignore:
Timestamp:
03/26/06 17:57:23 (9 years ago)
Author:
xi
Message:

Parser now provides style information. Allow empty plain scalars if a tag or anchor is given.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/branches/working-on-emitter/lib/yaml/tokens.py

    r122 r127  
    2525class DocumentStartToken(Token): 
    2626    id = '<document start>' 
     27    def __init__(self, name, value, start_mark=None, end_mark=None): 
     28        self.name = name 
     29        self.value = value 
     30        self.start_mark = start_mark 
     31        self.end_mark = end_mark 
    2732 
    2833class DocumentEndToken(Token): 
     
    3136class StreamStartToken(Token): 
    3237    id = '<stream start>' 
     38    def __init__(self, start_mark=None, end_mark=None, 
     39            encoding=None): 
     40        self.start_mark = start_mark 
     41        self.end_mark = end_mark 
     42        self.encoding = encoding 
    3343 
    3444class StreamEndToken(Token): 
     
    3747class BlockSequenceStartToken(Token): 
    3848    id = '<block sequence start>' 
     49    def __init__(self, start_mark=None, end_mark=None, 
     50            inline=None): 
     51        self.start_mark = start_mark 
     52        self.end_mark = end_mark 
     53        self.inline = inline 
    3954 
    4055class BlockMappingStartToken(Token): 
    4156    id = '<block mapping start>' 
     57    def __init__(self, start_mark=None, end_mark=None, 
     58            inline=None): 
     59        self.start_mark = start_mark 
     60        self.end_mark = end_mark 
     61        self.inline = inline 
    4262 
    4363class BlockEndToken(Token): 
     
    91111class ScalarToken(Token): 
    92112    id = '<scalar>' 
    93     def __init__(self, value, plain, start_mark=None, end_mark=None): 
     113    def __init__(self, value, plain, start_mark=None, end_mark=None, 
     114            style=None): 
    94115        self.value = value 
    95116        self.plain = plain 
    96117        self.start_mark = start_mark 
    97118        self.end_mark = end_mark 
     119        self.style = style 
    98120 
Note: See TracChangeset for help on using the changeset viewer.