Changeset 577
- Timestamp:
- 07/20/08 22:46:47 (2 months ago)
- Files:
-
- cly/trunk/cly/builder.py (modified) (2 diffs)
- cly/trunk/cly/parser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/builder.py
r576 r577 837 837 @classmethod 838 838 def attribute_aliases(cls): 839 return {'exec': 'callback'} 839 aliases = {'exec': 'callback'} 840 aliases.update(super(Action, cls).attribute_aliases()) 841 return aliases 840 842 841 843 @classmethod … … 1137 1139 data = {} 1138 1140 vars = {} 1141 1139 1142 def defined(vars, any=False): 1143 """Test if all (or any) of vars are defined.""" 1140 1144 for var in vars.split(): 1141 1145 defined = var in locals cly/trunk/cly/parser.py
r576 r577 348 348 return context 349 349 350 def merge(self, where, grammar):350 def merge(self, grammar, where=None): 351 351 """Merge another grammar into this one. 352 352 … … 355 355 :grammar: Grammar to merge. 356 356 """ 357 if where is None: 358 assert hasattr(grammar, 'graft'), \ 359 'need either an explicit "where" or a "graft" attribute on ' 360 'the <grammar> root' 361 where = grammar.graft 357 362 where = self.find(where) 358 363 where.update(grammar)
