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
I'm developing a text-to-diagram library, using nearley to generate parsers for different types of diagrams - which have quite different syntaxes so I tend to write separate parser for each one of them. I use @include to include common syntaxes.
Also this library is based on a plugin structure, developers can write their own diagrams, I think maybe I can publish the common syntaxes files and they can include them from node_modules.
But as far as I know, one can't include another .ne file without knowing the exact relative path of it. But writing something like @include "../../node_modules/@pintora/diagrams/lib/syntaxes/config.ne" is not so elegant, IMO.
Feature request
Here in Compile.js, I see there is either directory of current .ne file or process.cwd() for resolving include paths.
Some background
I'm developing a text-to-diagram library, using nearley to generate parsers for different types of diagrams - which have quite different syntaxes so I tend to write separate parser for each one of them. I use
@include
to include common syntaxes.Also this library is based on a plugin structure, developers can write their own diagrams, I think maybe I can publish the common syntaxes files and they can include them from node_modules.
But as far as I know, one can't include another
.ne
file without knowing the exact relative path of it. But writing something like@include "../../node_modules/@pintora/diagrams/lib/syntaxes/config.ne"
is not so elegant, IMO.Feature request
Here in
Compile.js
, I see there is either directory of current.ne
file orprocess.cwd()
for resolving include paths.Can we add an option
--include-paths
to nearleyc CLI for syntax file lookup ?If this is not a feature that, for some reason, is deliberately not implemented. I will be happy to add it.
The text was updated successfully, but these errors were encountered: