I have a grammar with @preprocessor typescript and that is compiled with nearleyc statement.ne -o grammar.ts.
I then try and use nearley-unparse grammar.ts but I'm met with
function id(d: any[]): any { return d[0]; }
^
SyntaxError: Unexpected token ':'
at wrapSafe (internal/modules/cjs/loader.js:983:16)
at Module._compile (internal/modules/cjs/loader.js:1033:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
at Module.load (internal/modules/cjs/loader.js:914:32)
at Function.Module._load (internal/modules/cjs/loader.js:822:14)
at Module.require (internal/modules/cjs/loader.js:956:19)
at new require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/joe/.nvm/versions/node/v13.1.0/lib/node_modules/nearley/bin/nearley-unparse.js:20:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
My current workaround is to remove the .preprocessor, recompile it and then I can unparse it
Pretty much what the title says.
I have a grammar with
@preprocessor typescript
and that is compiled withnearleyc statement.ne -o grammar.ts
.I then try and use
nearley-unparse grammar.ts
but I'm met withMy current workaround is to remove the .preprocessor, recompile it and then I can unparse it