##// END OF EJS Templates
revset: inline _getaliasarg() function...
Yuya Nishihara -
r28691:a04baf9c default
parent child Browse files
Show More
@@ -2261,12 +2261,6 b' def optimize(x, small):'
2261 return w + wa, (op, x[1], ta)
2261 return w + wa, (op, x[1], ta)
2262 return 1, x
2262 return 1, x
2263
2263
2264 def _getaliasarg(tree):
2265 """If tree matches ('_aliasarg', X) return X, None otherwise"""
2266 if tree[0] == '_aliasarg':
2267 return tree[1]
2268 return None
2269
2270 # the set of valid characters for the initial letter of symbols in
2264 # the set of valid characters for the initial letter of symbols in
2271 # alias declarations and definitions
2265 # alias declarations and definitions
2272 _aliassyminitletters = set(c for c in [chr(i) for i in xrange(256)]
2266 _aliassyminitletters = set(c for c in [chr(i) for i in xrange(256)]
@@ -2460,9 +2454,9 b' def _expandargs(tree, args):'
2460 """
2454 """
2461 if not tree or not isinstance(tree, tuple):
2455 if not tree or not isinstance(tree, tuple):
2462 return tree
2456 return tree
2463 arg = _getaliasarg(tree)
2457 if tree[0] == '_aliasarg':
2464 if arg is not None:
2458 sym = tree[1]
2465 return args[arg]
2459 return args[sym]
2466 return tuple(_expandargs(t, args) for t in tree)
2460 return tuple(_expandargs(t, args) for t in tree)
2467
2461
2468 def _expandaliases(aliases, tree, expanding, cache):
2462 def _expandaliases(aliases, tree, expanding, cache):
General Comments 0
You need to be logged in to leave comments. Login now