-
Hi, I just got my hands on Lark and am sorry, if this should be a banal question. Minimal example
ExpectedParsing algorithm evaluates ActualRegex in
Requirements
Workaround
First has the disadvantage to depend on the tokens of the upper Related(still errors with these)
QuestionIs this a limitation of the underlying Earley parsing algorithm with regexes or did I miss something? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can make this work by using Lark uses regex engines (either the stdlib You can use |
Beta Was this translation helpful? Give feedback.
You can make this work by using
lexer="dynamic_complete"
. This is very, very slow. For large inputs.Lark uses regex engines (either the stdlib
re
or the third partyregex
). Those will consume as much as they can, independent of the surrounding grammar. So the terminals lark sees are"["
,"FOobarbaz]"
and then$EOF
. This is not fixable from the park side without massive performance hits.You can use
foo: /./+
, but like the dynamic complete option, this will be very slow, and in addition the Tree will be annoying to use.