Skip to content

Commit

Permalink
--allowed-start-rule=\* documented for CLI. Fixes peggyjs#386.
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Mar 19, 2023
1 parent 6ed53e0 commit 180a004
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Released: TBD
- [#371](https://github.com/peggyjs/peggy/issues/371) Error using online Peggy - Can't find variable: util
- [#374](https://github.com/peggyjs/peggy/issues/374) CLI throws exception
on grammar errors. From @hildjj
= [#381](https://github.com/peggyjs/peggy/issues/381) Repetitions with code blocks
- [#381](https://github.com/peggyjs/peggy/issues/381) Repetitions with code blocks
for min or max not handling non-integer returns correctly.
- [#386](https://github.com/peggyjs/peggy/issues/381) Ensure '*' as
allowed-start-rule is documented for CLI.

3.0.1
-----
Expand Down
2 changes: 1 addition & 1 deletion bin/peggy-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class PeggyCLI extends Command {
.addOption(
new Option(
"--allowed-start-rules <rules>",
"Comma-separated list of rules the generated parser will be allowed to start parsing from. (Can be specified multiple times)"
"Comma-separated list of rules the generated parser will be allowed to start parsing from. Use '*' if you want any rule to be allowed as a start rule. (Can be specified multiple times)"
)
.default([], "the first rule in the grammar")
.argParser(commaArg)
Expand Down
3 changes: 2 additions & 1 deletion docs/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ <h3 id="generating-a-parser-command-line">Command Line</h3>
<dl>
<dt><code>--allowed-start-rules &lt;rules&gt;</code></dt>
<dd>Comma-separated list of rules the parser will be allowed to start parsing
from (default: only the first rule in the grammar).</dd>
from. Use '*' if you want any rule to be allowed as a start rule.
(default: only the first rule in the grammar).</dd>

<dt><code>--ast</code></dt>
<dd>Outputting an internal AST representation of the grammar after
Expand Down
6 changes: 4 additions & 2 deletions test/cli/run.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ Options:
-v, --version output the version number
--allowed-start-rules <rules> Comma-separated list of rules the generated
parser will be allowed to start parsing
from. (Can be specified multiple times)
(default: the first rule in the grammar)
from. Use '*' if you want any rule to be
allowed as a start rule. (Can be specified
multiple times) (default: the first rule in
the grammar)
--ast Output a grammar AST instead of a parser
code (default: false)
--cache Make generated parser cache results
Expand Down

0 comments on commit 180a004

Please sign in to comment.