Ignore:
Timestamp:
04/20/06 12:48:21 (9 years ago)
Author:
xi
Message:

Fix yaml-hl to use the new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/examples/yaml-hl/yaml_hl.py

    r136 r145  
    33import yaml, codecs, sys, optparse 
    44 
    5  
    6  
    7 yaml.add_resolver(u'!Config', []) 
    8 yaml.add_resolver(u'!TokensConfig', [u'tokens']) 
    9 yaml.add_resolver(u'!EventsConfig', [u'events']) 
    10 yaml.add_resolver(u'!StartEndConfig', [u'tokens', None]) 
    11 yaml.add_resolver(u'!StartEndConfig', [u'events', None]) 
     5#yaml.add_resolver(u'!Config', []) 
     6#yaml.add_resolver(u'!TokensConfig', [u'tokens']) 
     7#yaml.add_resolver(u'!EventsConfig', [u'events']) 
     8#yaml.add_resolver(u'!StartEndConfig', [u'tokens', None]) 
     9#yaml.add_resolver(u'!StartEndConfig', [u'events', None]) 
    1210 
    1311class YAMLHighlight: 
    1412 
    1513    def __init__(self, config): 
    16         parameters = yaml.load_document(config) 
     14        parameters = yaml.load(config) 
    1715        self.replaces = parameters['replaces'] 
    1816        self.substitutions = {} 
     
    3735            else: 
    3836                input = unicode(input, 'utf-8') 
    39         tokens = yaml.parse(input, Parser=iter) 
     37        tokens = yaml.scan(input) 
    4038        events = yaml.parse(input) 
    4139        markers = [] 
Note: See TracChangeset for help on using the changeset viewer.