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
My grammar is now too big to be kept in a single file. I gave a try to the import mechanism but the grammar failed to compile.
So I tested with two simple files and got the same error:
main.pegjs:
import { Digit } from'lib.js'Number=Digit+
lib.js:
Digit= [0-9]
$ yarn peggy lib.pegjs
$ yarn peggy main.pegjsError parsing grammarerror: Possible infinite loop when parsing (repetition used with an expression that may not consume any input) --> main.pegjs:3:10 |3 | Number = Digit+ | ^^^^^^
$ yarn peggy --version4.0.2
What am I doing wrong ?
The text was updated successfully, but these errors were encountered:
This is a real problem with how we're currently doing imports. I think I might have marked all imported rules as "might consume nothing", rather than marking each one with the correct information.
I think I know how to fix this, so assigning it to myself.
In order to solve this, I think we're going to need to either import or otherwise read in the library grammar when generating the main grammar. That likely means that we're going to need a new async top-level entrypoint.
This is something that has been contemplated in the past, but is going to require some discussion. Join us on the Peggy Discord if you want to follow along.
Hi,
My grammar is now too big to be kept in a single file. I gave a try to the import mechanism but the grammar failed to compile.
So I tested with two simple files and got the same error:
main.pegjs:
lib.js:
What am I doing wrong ?
The text was updated successfully, but these errors were encountered: