##// END OF EJS Templates
parser: rephrase "'$' not for alias arguments" message...
Yuya Nishihara -
r29058:dbed4c4f default
parent child Browse files
Show More
@@ -325,13 +325,13 b' class basealiasrules(object):'
325 325 >>> builddecl('foo')
326 326 ('foo', None, None)
327 327 >>> builddecl('$foo')
328 ('$foo', None, "'$' not for alias arguments")
328 ('$foo', None, "invalid symbol '$foo'")
329 329 >>> builddecl('foo::bar')
330 330 ('foo::bar', None, 'invalid format')
331 331 >>> builddecl('foo()')
332 332 ('foo', [], None)
333 333 >>> builddecl('$foo()')
334 ('$foo()', None, "'$' not for alias arguments")
334 ('$foo()', None, "invalid function '$foo'")
335 335 >>> builddecl('foo($1, $2)')
336 336 ('foo', ['$1', '$2'], None)
337 337 >>> builddecl('foo(bar_bar, baz.baz)')
@@ -358,7 +358,7 b' class basealiasrules(object):'
358 358 # "name = ...." style
359 359 name = tree[1]
360 360 if name.startswith('$'):
361 return (decl, None, _("'$' not for alias arguments"))
361 return (decl, None, _("invalid symbol '%s'") % name)
362 362 return (name, None, None)
363 363
364 364 func = cls._trygetfunc(tree)
@@ -366,7 +366,7 b' class basealiasrules(object):'
366 366 # "name(arg, ....) = ...." style
367 367 name, args = func
368 368 if name.startswith('$'):
369 return (decl, None, _("'$' not for alias arguments"))
369 return (decl, None, _("invalid function '%s'") % name)
370 370 if any(t[0] != cls._symbolnode for t in args):
371 371 return (decl, None, _("invalid argument list"))
372 372 if len(args) != len(set(args)):
@@ -389,7 +389,7 b' class basealiasrules(object):'
389 389 if sym in args:
390 390 op = '_aliasarg'
391 391 elif sym.startswith('$'):
392 raise error.ParseError(_("'$' not for alias arguments"))
392 raise error.ParseError(_("invalid symbol '%s'") % sym)
393 393 return (op, sym)
394 394
395 395 @classmethod
@@ -423,7 +423,7 b' class basealiasrules(object):'
423 423 ... builddefn('$1 or $bar', args)
424 424 ... except error.ParseError as inst:
425 425 ... print parseerrordetail(inst)
426 '$' not for alias arguments
426 invalid symbol '$bar'
427 427 >>> args = ['$1', '$10', 'foo']
428 428 >>> pprint(builddefn('$10 or baz', args))
429 429 (or
@@ -1967,7 +1967,7 b' test unknown reference:'
1967 1967 (func
1968 1968 ('symbol', 'unknownref')
1969 1969 ('symbol', '0'))
1970 abort: failed to parse the definition of revset alias "unknownref": '$' not for alias arguments
1970 abort: failed to parse the definition of revset alias "unknownref": invalid symbol '$2'
1971 1971 [255]
1972 1972
1973 1973 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
General Comments 0
You need to be logged in to leave comments. Login now