You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test input: "a \n \r \t \b \f \v \0 \' \" \\ \xff"
Output (from PEG Playground):
- String (a \n \r \t \b \f \v \0 \' \" \\ \xff)
Expected output:
- String (a \n \r \t \b \f \v \0 ' " \ xff)
I have tried a few variations, but this one seems to me to be the one most indicative of what I need.
I'm trying to parse strings with escape sequences, some keeping the escape while others drop it, but the Escape still includes the backslashes, even though I'm using token boundaries and the ignore operator to exclude NonCapturingEscape.
Am I doing something wrong? Or is this a bug in the parser?
Thank you for your time!
-- As a side, after I get this figured out I'm planning on making my grammar also accept escaped escape sequences, where input \\n becomes \n. If you have any pointers there I would be greatly appreciative! Thank you
The text was updated successfully, but these errors were encountered:
@stoneRdev, in short, cpp-peglib can't handle what you are trying to do with AstBase::token since it's a string view region to the original parsed text instead of a string as below:
Hello, I have been working on string parsing, and can't seem to get the token ignore operator to work.
Here's my grammar:
Test input:
"a \n \r \t \b \f \v \0 \' \" \\ \xff"
Output (from PEG Playground):
Expected output:
I have tried a few variations, but this one seems to me to be the one most indicative of what I need.
I'm trying to parse strings with escape sequences, some keeping the escape while others drop it, but the
Escape
still includes the backslashes, even though I'm using token boundaries and the ignore operator to excludeNonCapturingEscape
.Am I doing something wrong? Or is this a bug in the parser?
Thank you for your time!
-- As a side, after I get this figured out I'm planning on making my grammar also accept escaped escape sequences, where input
\\n
becomes\n
. If you have any pointers there I would be greatly appreciative! Thank youThe text was updated successfully, but these errors were encountered: