Changeset 223 for pyyaml/trunk/lib/yaml

Show
Ignore:
Timestamp:
08/13/06 09:46:20 (6 years ago)
Author:
xi
Message:

Completely rewrite the libyaml bindings.

Location:
pyyaml/trunk/lib/yaml
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/lib/yaml/__init__.py

    r153 r223  
    88from loader import * 
    99from dumper import * 
     10 
     11try: 
     12    from cyaml import * 
     13except ImportError: 
     14    pass 
    1015 
    1116def scan(stream, Loader=Loader): 
  • pyyaml/trunk/lib/yaml/composer.py

    r222 r223  
    3838        self.get_event() 
    3939 
    40         self.complete_anchors = {} 
     40        self.anchors = {} 
    4141        return node 
    4242 
  • pyyaml/trunk/lib/yaml/resolver.py

    r222 r223  
    7575 
    7676    def descend_resolver(self, current_node, current_index): 
     77        if not self.yaml_path_resolvers: 
     78            return 
    7779        exact_paths = {} 
    7880        prefix_paths = [] 
     
    9698 
    9799    def ascend_resolver(self): 
     100        if not self.yaml_path_resolvers: 
     101            return 
    98102        self.resolver_exact_paths.pop() 
    99103        self.resolver_prefix_paths.pop() 
     
    132136                    return tag 
    133137            implicit = implicit[1] 
    134         exact_paths = self.resolver_exact_paths[-1] 
    135         if kind in exact_paths: 
    136             return exact_paths[kind] 
    137         if None in exact_paths: 
    138             return exact_paths[None] 
     138        if self.yaml_path_resolvers: 
     139            exact_paths = self.resolver_exact_paths[-1] 
     140            if kind in exact_paths: 
     141                return exact_paths[kind] 
     142            if None in exact_paths: 
     143                return exact_paths[None] 
    139144        if kind is ScalarNode: 
    140145            return self.DEFAULT_SCALAR_TAG