##// 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 2261 return w + wa, (op, x[1], ta)
2262 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 2264 # the set of valid characters for the initial letter of symbols in
2271 2265 # alias declarations and definitions
2272 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 2455 if not tree or not isinstance(tree, tuple):
2462 2456 return tree
2463 arg = _getaliasarg(tree)
2464 if arg is not None:
2465 return args[arg]
2457 if tree[0] == '_aliasarg':
2458 sym = tree[1]
2459 return args[sym]
2466 2460 return tuple(_expandargs(t, args) for t in tree)
2467 2461
2468 2462 def _expandaliases(aliases, tree, expanding, cache):
General Comments 0
You need to be logged in to leave comments. Login now