Implicit expression #761
-
I made a tiny query language and I want to make an implicit boolean expression optional: Here the program = _{ SOI ~ implicit ~ EOI }
implicit= ${ or ~ (WHITESPACE+ ~ or )* }
or = !{ and ~ (or_op ~ and)+ | and }
and = { comp ~ (and_op ~ comp)+ | comp }
comp = { array ~ eq_op ~ array | array }
array = ${ term }
term = _{ ASCII_ALPHANUMERIC+ }
or_op = { "||" }
and_op = { "&&" }
eq_op = { "=" }
WHITESPACE = _{ " " | "\t" | NEWLINE } Example:
I don't understand why the implicit condition ( program = _{ SOI ~ implicit ~ EOI }
implicit= ${ term ~ (WHITESPACE+ ~ term )* }
term = _{ ASCII_ALPHANUMERIC+ }
WHITESPACE = _{ " " | "\t" | NEWLINE } In this case the program Context:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
From a quick look at the grammar, I can't see what rules it should follow to just get the implicit option (it seems it'll always end with one of those explicit operator options?). Have you tried stepping through the parsing process using the CLI debugger: #739 ? |
Beta Was this translation helpful? Give feedback.
-
Related issue: #762 |
Beta Was this translation helpful? Give feedback.
-
v2.5.3 was just published: #767 it should have a fix for that optimizer issue. |
Beta Was this translation helpful? Give feedback.
v2.5.3 was just published: #767 it should have a fix for that optimizer issue.