Skip to content
New issue

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

Missing wildcard #293

Closed
lmrcarneiro opened this issue Feb 13, 2023 · 2 comments
Closed

Missing wildcard #293

lmrcarneiro opened this issue Feb 13, 2023 · 2 comments

Comments

@lmrcarneiro
Copy link
Contributor

lmrcarneiro commented Feb 13, 2023

Hello, first of all thanks for the awesome project.

I think I noticed some missing wildcards on master/_examples/expr2/main.go.
On equality, comparison and addition structures the * symbol is present on the commentary but not on the struct definition. Maybe the ']' symbol symbolizes that? I'm not sure...

Example:
// equality → comparison ( ( "!=" | "==" ) comparison )* ;

Goes from:

type Equality struct {
	Comparison *Comparison `@@`
	Op         string      `[ @( "!" "=" | "=" "=" )`
	Next       *Equality   `  @@ ]`
}

To:

type Equality struct {
	Comparison *Comparison `@@`
	Op         string      `[ @( "!" "=" | "=" "=" )`
	Next       *Equality   `  @@ ]*`
}

Note the wildcard symbol on the Next component of the struct.
Repeat as needed on other structs.

Also, this is my first issue on github, so sorry if I'm missing something

@lmrcarneiro
Copy link
Contributor Author

Nevermind... Turns out that [expr] equals (expr)?*, is that right?

@alecthomas
Copy link
Owner

That is correct, though it is no longer supported so if you want to send a PR changing it to ()* that would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants