We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
Hello, I've took simpleexpr example as my starting point and extended it to cover all my cases.
But for some reason I can't parse simple math operation: floor division: //
//
I've prepared a simplified example to highlight my exact case:
Demo repo: https://github.com/aimestereo/go-dsl-floor-division-issue
package main import ( "github.com/alecthomas/participle/v2" ) type Expr struct { // doesn't matter if it's "/" "/" or "//" Op string `@( "+" | "!" "=" | "&" "&" | "/" "/" | "/" )` } var ( parser = participle.MustBuild[Expr]() )
EBNF:
Expr = ("+" | ("!" "=") | ("&" "&") | ("/" "/") | "/") .
Diagram:
Tests that I'm checking:
+
!=
&&
/
The text was updated successfully, but these errors were encountered:
You will need to define a custom lexer, the default lexer is the Go one which treats // as comments
Sorry, something went wrong.
No branches or pull requests
Hello, I've took simpleexpr example as my starting point and extended it to cover all my cases.
But for some reason I can't parse simple math operation: floor division:
//
I've prepared a simplified example to highlight my exact case:
Demo repo: https://github.com/aimestereo/go-dsl-floor-division-issue
EBNF:
Diagram:
Tests that I'm checking:
+
- ok!=
- ok&&
- ok/
- ok//
- failsThe text was updated successfully, but these errors were encountered: