mirror of https://github.com/lark-parser/lark.git
parent
d5036eefdd
commit
7e8488d1a0
|
@ -101,7 +101,7 @@ class Token(Str):
|
|||
|
||||
self.type = type_
|
||||
self.pos_in_stream = pos_in_stream
|
||||
self.value = Str(value)
|
||||
self.value = value
|
||||
self.line = line
|
||||
self.column = column
|
||||
self.end_line = end_line
|
||||
|
|
|
@ -12,7 +12,7 @@ from .parse_tree_builder import ParseTreeBuilder
|
|||
from .parser_frontends import LALR_TraditionalLexer
|
||||
from .common import LexerConf, ParserConf
|
||||
from .grammar import RuleOptions, Rule, Terminal, NonTerminal, Symbol
|
||||
from .utils import classify, suppress, dedup_list
|
||||
from .utils import classify, suppress, dedup_list, Str
|
||||
from .exceptions import GrammarError, UnexpectedCharacters, UnexpectedToken
|
||||
|
||||
from .tree import Tree, SlottedTree as ST
|
||||
|
@ -451,9 +451,9 @@ class PrepareSymbols(Transformer_InPlace):
|
|||
if isinstance(v, Tree):
|
||||
return v
|
||||
elif v.type == 'RULE':
|
||||
return NonTerminal(v.value)
|
||||
return NonTerminal(Str(v.value))
|
||||
elif v.type == 'TERMINAL':
|
||||
return Terminal(v.value, filter_out=v.startswith('_'))
|
||||
return Terminal(Str(v.value), filter_out=v.startswith('_'))
|
||||
assert False
|
||||
|
||||
def _choice_of_rules(rules):
|
||||
|
|
Loading…
Reference in New Issue