kach / nearley

📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript.
https://nearley.js.org
MIT License
3.57k stars 231 forks source link

feat: add `--include-paths` support in nearleyc #616

Open hikerpig opened 2 years ago

hikerpig commented 2 years ago

related #604

example:

@preprocessor typescript
@lexer lexer

@builtin "postprocessors.ne"

# from shared-grammars
@include "whitespace.ne"
@include "config.ne"
@include "comment.ne"
shared-grammars
├── comment.ne
├── config.d.ts
├── config.ne
└── whitespace.ne
src
└── gantt
nearleyc src/gantt/parser/gantt.ne --include-paths ./shared-grammars  -o src/gantt/parser/gantt.ts