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

vs.choice() always returns 0 when %whitespace is defined. #266

Closed
CameronTofer opened this issue Feb 1, 2023 · 1 comment
Closed

vs.choice() always returns 0 when %whitespace is defined. #266

CameronTofer opened this issue Feb 1, 2023 · 1 comment
Labels

Comments

@CameronTofer
Copy link

Hi, if I define %whitespace then prioritized choices always return 0.

auto grammar = R"(
type <- 'string' / 'int' / 'double'
%whitespace <- [ \t\r\n]*
)"

...

parser["type"] = [](const SemanticValues& vs) {
return vs.choice(); // choice and choice count are always 0. works if %whitespace line is deleted
};

am I missing something?

@yhirose
Copy link
Owner

yhirose commented Feb 2, 2023

@CameronTofer thanks for the report. It looks a bug. I'll look into it when I have time. Thanks!

@yhirose yhirose added the bug label Feb 2, 2023
@yhirose yhirose closed this as completed in d8ec599 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants