Skip to content

Potential issue with string example #23

Description

@tomtau

Currently the literals section of the book gives this as a string example:

string = { "\"" ~ (raw_string | escape)* ~ "\"" }

Is my understanding correct that this will parse " USA" as USA, discarding the initial , because the rule isn't atomic?

I'm having this issue myself. I'm getting around it by making the rule atomic, but it seems rules can't be atomic & silent, and so the parse tree contains the "s, which requires a bit more work downstream.

Thanks!

Originally posted by @max-sixty in pest-parser/pest#645

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions