revset: define _parsealias() in _aliasrules class

It's short. It doesn't make sense to define _parsealias() outside of the
class.
This commit is contained in:
Yuya Nishihara 2016-04-17 13:06:44 +09:00
parent 74d711b196
commit 96d6f9fd5f

View File

@ -2238,19 +2238,19 @@ def _parsewith(spec, lookup=None, syminitletters=None):
raise error.ParseError(_('invalid token'), pos)
return parser.simplifyinfixops(tree, ('list', 'or'))
def _parsealias(spec):
"""Parse alias declaration/definition ``spec``
This allows symbol names to use also ``$`` as an initial letter
(for backward compatibility), and callers of this function should
examine whether ``$`` is used also for unexpected symbols or not.
"""
return _parsewith(spec, syminitletters=_aliassyminitletters)
class _aliasrules(parser.basealiasrules):
"""Parsing and expansion rule set of revset aliases"""
_section = _('revset alias')
_parse = staticmethod(_parsealias)
@staticmethod
def _parse(spec):
"""Parse alias declaration/definition ``spec``
This allows symbol names to use also ``$`` as an initial letter
(for backward compatibility), and callers of this function should
examine whether ``$`` is used also for unexpected symbols or not.
"""
return _parsewith(spec, syminitletters=_aliassyminitletters)
@staticmethod
def _trygetfunc(tree):