Skip to content

Commit

Permalink
Add note about shell escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Feb 26, 2024
1 parent 9955b45 commit 78d1126
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -746,12 +746,13 @@ <h3 id="importing-external-rules">Importing External Rules</h3>
grammar, NOT the source. Grammars MUST be compiled by a version that
supports imports in order to be imported. Only rules that are allowed
start rules are valid. It can be useful to specify
<code>--allowed-start-rules *</code> in library grammars. Imports are
only valid in output formats "es" and "commonjs". If you
use imports, you should use <code>{ output: "source" }</code>; the default
output of "parser" will call `eval` on the source which fails immediately
for some formats (e.g. "es") and will not find modules in the expected
places for others (e.g. "commonjs"). The
<code>--allowed-start-rules *</code> (with appropriate escaping for
your shell!) in library grammars. Imports are only valid in output
formats "es" and "commonjs". If you use imports, you should use
<code>{ output: "source" }</code>; the default output of "parser" will
call `eval` on the source which fails immediately for some formats
(e.g. "es") and will not find modules in the expected places for others
(e.g. "commonjs"). The
<a href="https://github.com/peggyjs/from-mem/">from-mem</a> project is
used by the Peggy CLI to resolve these issues, but note well its
relatively severe limitations.</p>
Expand Down

0 comments on commit 78d1126

Please sign in to comment.