Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/parser.py @ 45799:0fc8b066928a
errors: name arguments to ParseError constructor
As with similar previous patches, this is to improve readability.
Differential Revision: https://phab.mercurial-scm.org/D9240
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 22 Oct 2020 09:58:05 -0700 |
parents | be8552f25cab |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45798:5bb900885311 | 45799:0fc8b066928a |
---|---|
406 | 406 |
407 | 407 |
408 def parseerrordetail(inst): | 408 def parseerrordetail(inst): |
409 """Compose error message from specified ParseError object | 409 """Compose error message from specified ParseError object |
410 """ | 410 """ |
411 if len(inst.args) > 1: | 411 if inst.location is not None: |
412 return _(b'at %d: %s') % (inst.args[1], inst.args[0]) | 412 return _(b'at %d: %s') % (inst.location, inst.message) |
413 else: | 413 else: |
414 return inst.args[0] | 414 return inst.message |
415 | 415 |
416 | 416 |
417 class alias(object): | 417 class alias(object): |
418 """Parsed result of alias""" | 418 """Parsed result of alias""" |
419 | 419 |