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

Interpreter unexpected behavior #37

Open
tassilucas opened this issue Apr 5, 2022 · 0 comments
Open

Interpreter unexpected behavior #37

tassilucas opened this issue Apr 5, 2022 · 0 comments

Comments

@tassilucas
Copy link
Contributor

The following APEG grammar is fully consumed by the interpreter but the status received is rejected (which should've be accepted):

apeg exprdeclaration;

prog[language g]: ops<g, n> {x={| #n |};} (',' ops<g, n1> {x={| #x / #n1 |};})*
                  ' : ' {g = g << {| op[language g]: #x ; |};} var<g> ;

ops[language g] returns `s`: s='+' / s='-' / s='*' ;

var[language g]: a..z+ ' = ' expression<g> ';' ;                                              

expression[language g]: factor<g> op<g> expression<g> /                                       
                        factor<g> ;                                                           

factor[language g]: 0..9+ / a..z+ ;

op[language g]: {? false };

and an input example could be:

+,-,* : x = 10+20*30;

This grammar can also be found on the interpreter tests package.

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

1 participant