Closed wszgrcy closed 1 year ago
I add !.
to sovled ,but I don't know the /
real purpose
a / b
tries a
, and if it matches, then the whole rule matches without trying b
. At a higher level, if there is input left when your grammar's first rule matches, that's an error.
a / b
triesa
, and if it matches, then the whole rule matches without tryingb
. At a higher level, if there is input left when your grammar's first rule matches, that's an error.
not match
and match but not full match
are two different status? so I need to convert match but not full match
=>not match
(add !.
not match any char in end)
If you want to match just the beginning part of text, and don't care if there is extra text at the end, you could do:
INPUT
= value1:'aabbcc' .*
/ value2:.*
I am assuming this fixed your issue. If not, please re-open, and ask more questions.
I want match rule1 or rule2 or ... and return a object
{value,type}
if inputaabbcc
(less or equal than first expression) ,can get output, but if inputaabbccd
(greater than first expression), throw errorIs there a problem with me using it? I think
/
is likerule1||rule2|...||rule
,But it seems like partial success is considered a success