diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-20 18:43:21 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-20 18:43:21 -0400 |
| commit | fcbf399c80ad7b6a8f9f7980132e2f28d200c9d5 (patch) | |
| tree | bad7804e8f7b3ec6085019250bb805d59d00f965 | |
| parent | 1ed779f6b9c3c19d2188e818fe6785a71c6537ba (diff) | |
DEF statement doesn't exist
| -rw-r--r-- | docs/spec/grammar.html | 4 | ||||
| -rw-r--r-- | spec/grammar.md | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index a38aff35..4928aed8 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -7,9 +7,9 @@ <h1 id="specification-bqn-grammar">Specification: BQN grammar</h1> <p>BQN's grammar is given below. Terms are defined in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. However, handling special names properly is possible but difficult in BNF, so they are explained in text along with the braced block grammar.</p> <p>The symbols <code><span class='Value'>s</span></code>, <code><span class='Function'>F</span></code>, <code><span class='Modifier'>_m</span></code>, and <code><span class='Modifier2'>_c_</span></code> are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, <code><span class='Value'>sl</span></code>, <code><span class='Function'>Fl</span></code>, <code><span class='Modifier'>_ml</span></code>, and <code><span class='Modifier2'>_cl_</span></code> refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program.</p> -<p>A program is a list of statements. Almost all statements are expressions. However, explicit definitions and valueless results stemming from <code><span class='Nothing'>ยท</span></code>, or <code><span class='Value'>๐จ</span></code> in a monadic brace function, can be used as statements but not expressions.</p> +<p>A program is a list of statements. Almost all statements are expressions. Only valueless results stemming from <code><span class='Nothing'>ยท</span></code>, or <code><span class='Value'>๐จ</span></code> in a monadic brace function, can be used as statements but not expressions.</p> <pre><span class='Function'>PROGRAM</span> <span class='Function'>=</span> <span class='Separator'>โ</span><span class='Value'>?</span> <span class='Paren'>(</span> <span class='Paren'>(</span> <span class='Function'>STMT</span> <span class='Separator'>โ</span> <span class='Paren'>)</span><span class='Value'>*</span> <span class='Function'>STMT</span> <span class='Separator'>โ</span><span class='Value'>?</span> <span class='Paren'>)</span><span class='Value'>?</span> -<span class='Function'>STMT</span> <span class='Function'>=</span> <span class='Function'>EXPR</span> <span class='Function'>|</span> <span class='Function'>DEF</span> <span class='Function'>|</span> <span class='Value'>nothing</span> +<span class='Function'>STMT</span> <span class='Function'>=</span> <span class='Function'>EXPR</span> <span class='Function'>|</span> <span class='Value'>nothing</span> <span class='Separator'>โ</span> <span class='Function'>=</span> <span class='Paren'>(</span> <span class='String'>"โ"</span> <span class='Function'>|</span> <span class='String'>","</span> <span class='Function'>|</span> <span class='Value'>\n</span> <span class='Paren'>)</span><span class='Function'>+</span> <span class='Function'>EXPR</span> <span class='Function'>=</span> <span class='Value'>subExpr</span> <span class='Function'>|</span> <span class='Function'>FuncExpr</span> <span class='Function'>|</span> <span class='Modifier'>_m1Expr</span> <span class='Function'>|</span> <span class='Modifier2'>_m2Expr_</span> </pre> diff --git a/spec/grammar.md b/spec/grammar.md index 3808ac28..25d48295 100644 --- a/spec/grammar.md +++ b/spec/grammar.md @@ -6,10 +6,10 @@ BQN's grammar is given below. Terms are defined in a [BNF](https://en.wikipedia. The symbols `s`, `F`, `_m`, and `_c_` are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, `sl`, `Fl`, `_ml`, and `_cl_` refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program. -A program is a list of statements. Almost all statements are expressions. However, explicit definitions and valueless results stemming from `ยท`, or `๐จ` in a monadic brace function, can be used as statements but not expressions. +A program is a list of statements. Almost all statements are expressions. Only valueless results stemming from `ยท`, or `๐จ` in a monadic brace function, can be used as statements but not expressions. PROGRAM = โ? ( ( STMT โ )* STMT โ? )? - STMT = EXPR | DEF | nothing + STMT = EXPR | nothing โ = ( "โ" | "," | \n )+ EXPR = subExpr | FuncExpr | _m1Expr | _m2Expr_ |
