kozily / nearley-loader

Compiles a grammar from a nearley grammar file.
14 stars 7 forks source link

@include broken for nearley >= 2.16.0 #8

Open cemulate opened 4 years ago

cemulate commented 4 years ago

Nearley made an internal change with how they handle CLI arguments internally in this commit before release 2.16.0.

Unfortunately, that change breaks this package. The context for handling @include directives does not get correctly passed to Nearley. The change needed to handle this is as follows, in src/index.js+12:

- var compilation = compile(parser.results[0], {file: this.resourcePath});
+ var compilation = compile(parser.results[0], {args: [this.resourcePath]});

But I'm not sure what would be wisest to do about versioning. Perhaps bump the major version here and say that ^2 only works with nearley<2.16.0? It's unfortunate for sure.

mspoulsen commented 4 years ago

Somebody please fix this! :+1: