Skip to content

Commit

Permalink
deploy: 7906d7b
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Feb 23, 2024
1 parent e7ffa91 commit 7a527cc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ <h3 id="generating-a-parser-command-line">Command Line</h3>
<p>To generate a parser from your grammar, use the <code>peggy</code>
command:</p>

<pre><code class="language-console">$ peggy arithmetics.pegjs</code></pre>
<pre><code class="language-console">$ npx peggy arithmetics.pegjs</code></pre>

<p>This writes parser source code into a file with the same name as the grammar
file but with “.js” extension. You can also specify the output file
explicitly:</p>

<pre><code class="language-console">$ peggy -o arithmetics-parser.js arithmetics.pegjs</code></pre>
<pre><code class="language-console">$ npx peggy -o arithmetics-parser.js arithmetics.pegjs</code></pre>

<p>If you omit both input and output file, standard input and standard output
are used.</p>
Expand Down Expand Up @@ -327,33 +327,33 @@ <h3 id="generating-a-parser-command-line">Command Line</h3>

<pre><code class="language-console"># - write test results to stdout (42)
# - exit with the code 0
echo "foo = '1' { return 42 }" | peggy --test 1
echo "foo = '1' { return 42 }" | npx peggy --test 1

# - write a parser error to stdout (Expected "1" but "2" found)
# - exit with the code 2
echo "foo = '1' { return 42 }" | peggy --test 2
echo "foo = '1' { return 42 }" | npx peggy --test 2

# - write an error to stdout (Generation of the source map is useless if you don't
# store a generated parser code, perhaps you forgot to add an `-o/--output` option?)
# - exit with the code 1
echo "foo = '1' { return 42 }" | peggy --source-map --test 1
echo "foo = '1' { return 42 }" | npx peggy --source-map --test 1

# - write an error to stdout (Generation of the source map is useless if you don't
# store a generated parser code, perhaps you forgot to add an `-o/--output` option?)
# - exit with the code 1
echo "foo = '1' { return 42 }" | peggy --source-map --test 2
echo "foo = '1' { return 42 }" | npx peggy --source-map --test 2

# - write an output to `parser.js`,
# - write a source map to `parser.js.map`
# - write test results to stdout (42)
# - exit with the code 0
echo "foo = '1' { return 42 }" | peggy --output parser.js --source-map --test 1
echo "foo = '1' { return 42 }" | npx peggy --output parser.js --source-map --test 1

# - write an output to `parser.js`,
# - write a source map to `parser.js.map`
# - write a parser error to stdout (Expected "1" but "2" found)
# - exit with the code 2
echo "foo = '1' { return 42 }" | peggy --output parser.js --source-map --test 2
echo "foo = '1' { return 42 }" | npx peggy --output parser.js --source-map --test 2
</code></pre>

<h3 id="generating-a-parser-javascript-api">JavaScript API</h3>
Expand Down Expand Up @@ -758,7 +758,7 @@ <h3 id="importing-external-rules">Importing External Rules</h3>
<p><code>number.peggy</code>:</p>
<pre><code class="language-peggy">number = n:$[0-9]+ { return parseInt(n, 10); }</code></pre>
<p>Generate:</p>
<pre><code class="language-console">$ peggy csv.peggy number.peggy</code></pre>
<pre><code class="language-console">$ npx peggy csv.peggy number.peggy</code></pre>
</li>

<li>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>Parser Generator for JavaScript</h2>
<div class="label">Download browser version</div>
<span id="download">
<a title="Download a minified version of Peggy for the browser"
href="https://unpkg.com/[email protected].0/browser/peggy.min.js">minified</a>
href="https://unpkg.com/[email protected].1/browser/peggy.min.js">minified</a>
</span>
<iframe id="discord"
src="https://discordapp.com/widget?id=985995982909100082&theme=dark"
Expand Down
4 changes: 2 additions & 2 deletions js/benchmark-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/examples.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by Peggy 4.0.0.
// @generated by Peggy 4.0.1.
//
// https://peggyjs.org/
(function(root) {
Expand Down
4 changes: 2 additions & 2 deletions js/test-bundle.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/peggy/peggy.min.js

Large diffs are not rendered by default.

0 comments on commit 7a527cc

Please sign in to comment.