You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am creating a small programming language and i have set the grammar to handle statements like this:
statements
-> statement %NL
{%
(data) => {
return [data[0]];
}
%}
| statements %NL statement %NL
{%
(data) => {
return [...data[0], data[2]];
}
%}
but everytime is reaches the newline token it throws this error:
Error while parsing Error: invalid syntax at line 1 col 19:
1 @name = "mohammad"
^
2 call print(name)
Unexpected input (lexer error). I did not expect any more input. Here is the state of my parse table:
i am creating a small programming language and i have set the grammar to handle statements like this:
statements
-> statement %NL
{%
(data) => {
return [data[0]];
}
%}
| statements %NL statement %NL
{%
(data) => {
return [...data[0], data[2]];
}
%}
but everytime is reaches the newline token it throws this error:
Error while parsing Error: invalid syntax at line 1 col 19:
1 @name = "mohammad"
^
2 call print(name)
Unexpected input (lexer error). I did not expect any more input. Here is the state of my parse table:
this is only in case of newline token everything else works fine
The text was updated successfully, but these errors were encountered: