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:
+ - ok
!= - ok
&& - ok
/ - ok
// - fails
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//- fails