From 180a00437fa3610fb81ff65efa171b4b9780a62b Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Sun, 19 Mar 2023 16:24:50 -0600 Subject: [PATCH] --allowed-start-rule=\* documented for CLI. Fixes #386. --- CHANGELOG.md | 4 +++- bin/peggy-cli.js | 2 +- docs/documentation.html | 3 ++- test/cli/run.spec.ts | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9878e0a9..7cca5a9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ----- diff --git a/bin/peggy-cli.js b/bin/peggy-cli.js index e3d3f2e6..1d40361d 100644 --- a/bin/peggy-cli.js +++ b/bin/peggy-cli.js @@ -106,7 +106,7 @@ class PeggyCLI extends Command { .addOption( new Option( "--allowed-start-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) diff --git a/docs/documentation.html b/docs/documentation.html index 6a3a7b27..872e3ef9 100644 --- a/docs/documentation.html +++ b/docs/documentation.html @@ -118,7 +118,8 @@

Command Line

--allowed-start-rules <rules>
Comma-separated list of rules the parser will be allowed to start parsing - from (default: only the first rule in the grammar).
+ from. Use '*' if you want any rule to be allowed as a start rule. + (default: only the first rule in the grammar).
--ast
Outputting an internal AST representation of the grammar after diff --git a/test/cli/run.spec.ts b/test/cli/run.spec.ts index e6875cc0..2cf25e4d 100644 --- a/test/cli/run.spec.ts +++ b/test/cli/run.spec.ts @@ -320,8 +320,10 @@ Options: -v, --version output the version number --allowed-start-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