We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unexpected token "<EOF>"
Here is the simple example I am trying to use:
// nolint: govet, golint package main import ( "github.com/alecthomas/participle/v2" "github.com/alecthomas/participle/v2/lexer" "github.com/alecthomas/repr" ) type Text struct { Pos lexer.Position First string ` @ident ` } var ( testParser = participle.MustBuild[Text]( participle.Lexer( lexer.MustSimple( []lexer.SimpleRule{ // Letters and Digits {"letter", `[a-zA-Z]`}, {"decimalDigit", `[0-9]`}, // Identifiers {"ident", `letter ( letter | decimalDigit )*`}, }), ), ) ) func main() { proto, err := testParser.ParseString("string_test", `something`) if err != nil { panic(err) } repr.Println(proto, repr.Hide(&lexer.Position{})) }
And it is giving me the error:
panic: string_test:1:10: unexpected token "<EOF>"
I have tried adding the token for <EOF> but couldn't manage to do it. Also I couldn't find any documentation regarding this.
<EOF>
I am using MacOS w/ go 1.19.3
The text was updated successfully, but these errors were encountered:
Your lexer is not correct. Each entry is a self-contained regex pattern.
Sorry, something went wrong.
Try looking through the _examples folder.
Got it, I am hoping this issue will guide other who also see the same issue.
My observation is: If lever fails to parse any rule it seems like this EOF error is thrown.
No branches or pull requests
Here is the simple example I am trying to use:
And it is giving me the error:
I have tried adding the token for
<EOF>
but couldn't manage to do it. Also I couldn't find any documentation regarding this.I am using MacOS w/ go 1.19.3
The text was updated successfully, but these errors were encountered: