Skip to content

Literal tokens beginning with @ fail? #411

@nkcmr

Description

@nkcmr

I am trying to use this library to try to create a Go parser of Turtle. One of the productions of Turtle is a line that literally begins with @prefix (here).

When I try to create a parser that specifies that the "@prefix" token starts the line, it just doesn't work in Participle. I've condensed this issue into a small, runnable snippet here: https://go.dev/play/p/kOQ2_bAA2Re

This snippet builds 2 parsers:

GRAMMAR (broken):
ProgramBroken = WordBroken* .
WordBroken = "@word" <string> ";" .

GRAMMAR (ok):
ProgramOK = WordOK* .
WordOK = "word" <string> ";" .

The one that makes use of the @ symbol does not seem to work, but when the grammar does not use the @ symbol, it works fine.

I apologize if I have missed something obvious in the documentation, but I did scan around for a few hours to try to get past this issue to no avail. Please let me know if any other info helps, and obviously: thank you so much for this library and your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions