Closed naddeoa closed 7 months ago
https://github.com/lark-parser/lark/blob/942366b49247e996e387cb901ed96c7d861382a0/lark/tree.py#L58
The type claims that Tree.data is a str but in practice, when you print(type(tree.data)) it's a actually of type lark.lexer.Token.
str
print(type(tree.data))
lark.lexer.Token
ast = lark.parse(example) print(type(ast.data))
Just noticed it's a subclass of str, wasn't expecting that.
https://github.com/lark-parser/lark/blob/942366b49247e996e387cb901ed96c7d861382a0/lark/tree.py#L58
The type claims that Tree.data is a
str
but in practice, when youprint(type(tree.data))
it's a actually of typelark.lexer.Token
.