Skip to content

Commit fdfb9eb

Browse files
committed
verify-grammar llnextgen
When calling make verify-grammar a lot of errors are reported by llnextgen. Only simple errors like: missing semicolons, missing single quotes, usage of parentheses instead of squared brackets or usage of single quote instead of double quote are fixed by this patch. This can only be tested, when llnextgen is installed. Signed-off-by: Jan Kobler <[email protected]>
1 parent 2b05263 commit fdfb9eb

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/doc/rust.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Some productions are defined by exclusion of particular Unicode characters:
153153
~~~~ {.notrust .ebnf .gram}
154154
comment : block_comment | line_comment ;
155155
block_comment : "/*" block_comment_body * '*' + '/' ;
156-
block_comment_body : (block_comment | character) * ;
156+
block_comment_body : [block_comment | character] * ;
157157
line_comment : "//" non_eol * ;
158158
~~~~
159159

@@ -497,16 +497,16 @@ All of the above extensions are expressions with values.
497497
## Macros
498498

499499
~~~~ {.notrust .ebnf .gram}
500-
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')'
501-
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';'
500+
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ;
501+
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ;
502502
matcher : '(' matcher * ')' | '[' matcher * ']'
503503
| '{' matcher * '}' | '$' ident ':' ident
504504
| '$' '(' matcher * ')' sep_token? [ '*' | '+' ]
505-
| non_special_token
505+
| non_special_token ;
506506
transcriber : '(' transcriber * ')' | '[' transcriber * ']'
507507
| '{' transcriber * '}' | '$' ident
508508
| '$' '(' transcriber * ')' sep_token? [ '*' | '+' ]
509-
| non_special_token
509+
| non_special_token ;
510510
~~~~
511511

512512
User-defined syntax extensions are called "macros",
@@ -803,7 +803,7 @@ use_decl : "pub" ? "use" ident [ '=' path
803803
804804
path_glob : ident [ "::" path_glob ] ?
805805
| '*'
806-
| '{' ident [ ',' ident ] * '}'
806+
| '{' ident [ ',' ident ] * '}' ;
807807
~~~~
808808

809809
A _use declaration_ creates one or more local name bindings synonymous
@@ -1458,7 +1458,7 @@ impl Seq<bool> for u32 {
14581458
### External blocks
14591459

14601460
~~~~ {.notrust .ebnf .gram}
1461-
extern_block_item : "extern" '{' extern_block '} ;
1461+
extern_block_item : "extern" '{' extern_block '}' ;
14621462
extern_block : [ foreign_fn ] * ;
14631463
~~~~
14641464

@@ -1684,7 +1684,7 @@ import public items from their destination, not private items.
16841684

16851685
~~~~ {.notrust .ebnf .gram}
16861686
attribute : '#' '[' attr_list ']' ;
1687-
attr_list : attr [ ',' attr_list ]*
1687+
attr_list : attr [ ',' attr_list ]* ;
16881688
attr : ident [ '=' literal
16891689
| '(' attr_list ')' ] ? ;
16901690
~~~~
@@ -2332,7 +2332,7 @@ struct_expr : expr_path '{' ident ':' expr
23322332
[ ".." expr ] '}' |
23332333
expr_path '(' expr
23342334
[ ',' expr ] * ')' |
2335-
expr_path
2335+
expr_path ;
23362336
~~~~
23372337

23382338
There are several forms of structure expressions.
@@ -2383,7 +2383,7 @@ Point3d {y: 0, z: 10, .. base};
23832383
~~~~ {.notrust .ebnf .gram}
23842384
block_expr : '{' [ view_item ] *
23852385
[ stmt ';' | item ] *
2386-
[ expr ] '}'
2386+
[ expr ] '}' ;
23872387
~~~~
23882388

23892389
A _block expression_ is similar to a module in terms of the declarations that
@@ -2410,7 +2410,7 @@ or dynamically dispatching if the left-hand-side expression is an indirect [obje
24102410
### Field expressions
24112411

24122412
~~~~ {.notrust .ebnf .gram}
2413-
field_expr : expr '.' ident
2413+
field_expr : expr '.' ident ;
24142414
~~~~
24152415

24162416
A _field expression_ consists of an expression followed by a single dot and an identifier,
@@ -2432,9 +2432,9 @@ it is automatically dereferenced to make the field access possible.
24322432
### Vector expressions
24332433

24342434
~~~~ {.notrust .ebnf .gram}
2435-
vec_expr : '[' "mut" ? vec_elems? ']'
2435+
vec_expr : '[' "mut" ? vec_elems? ']' ;
24362436
2437-
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
2437+
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
24382438
~~~~
24392439

24402440
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
@@ -2454,7 +2454,7 @@ as a [literal](#literals) or a [static item](#static-items).
24542454
### Index expressions
24552455

24562456
~~~~ {.notrust .ebnf .gram}
2457-
idx_expr : expr '[' expr ']'
2457+
idx_expr : expr '[' expr ']' ;
24582458
~~~~
24592459

24602460
[Vector](#vector-types)-typed expressions can be indexed by writing a
@@ -2876,7 +2876,7 @@ then any `else` block is executed.
28762876
~~~~ {.notrust .ebnf .gram}
28772877
match_expr : "match" expr '{' match_arm [ '|' match_arm ] * '}' ;
28782878
2879-
match_arm : match_pat '=>' [ expr "," | '{' block '}' ] ;
2879+
match_arm : match_pat "=>" [ expr "," | '{' block '}' ] ;
28802880
28812881
match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
28822882
~~~~

0 commit comments

Comments
 (0)