nearley icon indicating copy to clipboard operation
nearley copied to clipboard

nearley-unparser binary: rules.map is not a function

Open the-jasoney opened this issue 2 years ago • 0 comments

I am using nearley with the typescript preprocessor and I get this error when I try to use nearley.test:

TypeError: rules.map is not a function
    at Grammar.fromCompiled (C:\Users\jasoney\Documents\GitHub\kun\node_modules\nearley\lib\nearley.js:172:27)
    at Unparse (C:\Users\jasoney\Documents\GitHub\kun\node_modules\nearley\lib\unparse.js:128:43)
    at Object.<anonymous> (C:\Users\jasoney\Documents\GitHub\kun\node_modules\nearley\bin\nearley-unparse.js:27:18)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Node.js v18.4.0

nearley-unparse seems to be working fine with a JS grammar.

the-jasoney avatar Jun 22 '22 19:06 the-jasoney