Closed jonhue closed 5 years ago
I have a grammar that is structured like this:
package: $ => seq($.statement_list, /(\r?\n)*/), statement: $ => choice( // ... ), statement_list: $ => seq( $.statement, repeat(seq($.newline, $.statement)) ), newline: $ => /\r?\n|\r/
But when I try to parse a multiline file, say:
1 1
the parser throws an error. It appears to be interpreting this as two statement lists (even though it is just one) and then throws an error because a package can only consist of one statement list.
What is the proper way of doing this?
I have a grammar that is structured like this:
But when I try to parse a multiline file, say:
the parser throws an error. It appears to be interpreting this as two statement lists (even though it is just one) and then throws an error because a package can only consist of one statement list.
What is the proper way of doing this?