diff options
-rw-r--r-- | lib/spack/spack/spec.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 7c09af4c21..16b61236a9 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2015,10 +2015,13 @@ class SpecLexer(spack.parse.Lexer): (r'\s+', lambda scanner, val: None)]) +# Lexer is always the same for every parser. +_lexer = SpecLexer() + class SpecParser(spack.parse.Parser): def __init__(self): - super(SpecParser, self).__init__(SpecLexer()) + super(SpecParser, self).__init__(_lexer) self.previous = None def do_parse(self): |