Show More
@@ -473,8 +473,8 b' class basealiasrules(object):' | |||
|
473 | 473 | |
|
474 | 474 | @classmethod |
|
475 | 475 | def _getalias(cls, aliases, tree): |
|
476 |
"""If tree looks like an unexpanded alias, return |
|
|
477 | otherwise. | |
|
476 | """If tree looks like an unexpanded alias, return (alias, pattern-args) | |
|
477 | pair. Return None otherwise. | |
|
478 | 478 | """ |
|
479 | 479 | if not isinstance(tree, tuple): |
|
480 | 480 | return None |
@@ -482,12 +482,12 b' class basealiasrules(object):' | |||
|
482 | 482 | name = tree[1] |
|
483 | 483 | a = aliases.get(name) |
|
484 | 484 | if a and a.args is None: |
|
485 | return a | |
|
485 | return a, None | |
|
486 | 486 | if tree[0] == cls._funcnode and tree[1][0] == cls._symbolnode: |
|
487 | 487 | name = tree[1][1] |
|
488 | 488 | a = aliases.get(name) |
|
489 | 489 | if a and a.args is not None: |
|
490 | return a | |
|
490 | return a, cls._getlist(tree[2]) | |
|
491 | 491 | return None |
|
492 | 492 | |
|
493 | 493 | @classmethod |
@@ -506,10 +506,11 b' class basealiasrules(object):' | |||
|
506 | 506 | def _expand(cls, aliases, tree, expanding, cache): |
|
507 | 507 | if not isinstance(tree, tuple): |
|
508 | 508 | return tree |
|
509 |
|
|
|
510 |
if |
|
|
509 | r = cls._getalias(aliases, tree) | |
|
510 | if r is None: | |
|
511 | 511 | return tuple(cls._expand(aliases, t, expanding, cache) |
|
512 | 512 | for t in tree) |
|
513 | a, l = r | |
|
513 | 514 | if a.error: |
|
514 | 515 | raise error.Abort(a.error) |
|
515 | 516 | if a in expanding: |
@@ -526,7 +527,6 b' class basealiasrules(object):' | |||
|
526 | 527 | if a.args is None: |
|
527 | 528 | return result |
|
528 | 529 | # substitute function arguments in replacement tree |
|
529 | l = cls._getlist(tree[2]) | |
|
530 | 530 | if len(l) != len(a.args): |
|
531 | 531 | raise error.ParseError(_('invalid number of arguments: %d') |
|
532 | 532 | % len(l)) |
General Comments 0
You need to be logged in to leave comments.
Login now