Show More
@@ -332,25 +332,6 b' def getargsdict(x, funcname, keys):' | |||
|
332 | 332 | return parser.buildargsdict(getlist(x), funcname, keys.split(), |
|
333 | 333 | keyvaluenode='keyvalue', keynode='symbol') |
|
334 | 334 | |
|
335 | def isvalidfunc(tree): | |
|
336 | """Examine whether specified ``tree`` is valid ``func`` or not | |
|
337 | """ | |
|
338 | return tree[0] == 'func' and tree[1][0] == 'symbol' | |
|
339 | ||
|
340 | def getfuncname(tree): | |
|
341 | """Get function name from valid ``func`` in ``tree`` | |
|
342 | ||
|
343 | This assumes that ``tree`` is already examined by ``isvalidfunc``. | |
|
344 | """ | |
|
345 | return tree[1][1] | |
|
346 | ||
|
347 | def getfuncargs(tree): | |
|
348 | """Get list of function arguments from valid ``func`` in ``tree`` | |
|
349 | ||
|
350 | This assumes that ``tree`` is already examined by ``isvalidfunc``. | |
|
351 | """ | |
|
352 | return getlist(tree[2]) | |
|
353 | ||
|
354 | 335 | def getset(repo, subset, x): |
|
355 | 336 | if not x: |
|
356 | 337 | raise error.ParseError(_("missing argument")) |
@@ -2314,13 +2295,13 b' def _parsealiasdecl(decl):' | |||
|
2314 | 2295 | return (decl, None, None, _("'$' not for alias arguments")) |
|
2315 | 2296 | return (name, ('symbol', name), None, None) |
|
2316 | 2297 | |
|
2317 | if isvalidfunc(tree): | |
|
2298 | if tree[0] == 'func' and tree[1][0] == 'symbol': | |
|
2318 | 2299 | # "name(arg, ....) = ...." style |
|
2319 |
name = |
|
|
2300 | name = tree[1][1] | |
|
2320 | 2301 | if name.startswith('$'): |
|
2321 | 2302 | return (decl, None, None, _("'$' not for alias arguments")) |
|
2322 | 2303 | args = [] |
|
2323 |
for arg in get |
|
|
2304 | for arg in getlist(tree[2]): | |
|
2324 | 2305 | if arg[0] != 'symbol': |
|
2325 | 2306 | return (decl, None, None, _("invalid argument list")) |
|
2326 | 2307 | args.append(arg[1]) |
General Comments 0
You need to be logged in to leave comments.
Login now