Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/parser.py @ 49037:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
49036:55d132525155 | 49037:642e31cb55f0 |
---|---|
23 util, | 23 util, |
24 ) | 24 ) |
25 from .utils import stringutil | 25 from .utils import stringutil |
26 | 26 |
27 | 27 |
28 class parser(object): | 28 class parser: |
29 def __init__(self, elements, methods=None): | 29 def __init__(self, elements, methods=None): |
30 self._elements = elements | 30 self._elements = elements |
31 self._methods = methods | 31 self._methods = methods |
32 self.current = None | 32 self.current = None |
33 | 33 |
413 return _(b'at %d: %s') % (inst.location, inst.message) | 413 return _(b'at %d: %s') % (inst.location, inst.message) |
414 else: | 414 else: |
415 return inst.message | 415 return inst.message |
416 | 416 |
417 | 417 |
418 class alias(object): | 418 class alias: |
419 """Parsed result of alias""" | 419 """Parsed result of alias""" |
420 | 420 |
421 def __init__(self, name, args, err, replacement): | 421 def __init__(self, name, args, err, replacement): |
422 self.name = name | 422 self.name = name |
423 self.args = args | 423 self.args = args |
427 # this avoids showing same warning multiple times at each | 427 # this avoids showing same warning multiple times at each |
428 # `expandaliases`. | 428 # `expandaliases`. |
429 self.warned = False | 429 self.warned = False |
430 | 430 |
431 | 431 |
432 class basealiasrules(object): | 432 class basealiasrules: |
433 """Parsing and expansion rule set of aliases | 433 """Parsing and expansion rule set of aliases |
434 | 434 |
435 This is a helper for fileset/revset/template aliases. A concrete rule set | 435 This is a helper for fileset/revset/template aliases. A concrete rule set |
436 should be made by sub-classing this and implementing class/static methods. | 436 should be made by sub-classing this and implementing class/static methods. |
437 | 437 |