Skip to content

Commit

Permalink
verify-grammar llnextgen
Browse files Browse the repository at this point in the history
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 <eng1@koblersystems.de>
  • Loading branch information
jankobler committed Mar 27, 2014
1 parent 2b05263 commit fdfb9eb
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/doc/rust.md
Expand Up @@ -153,7 +153,7 @@ Some productions are defined by exclusion of particular Unicode characters:
~~~~ {.notrust .ebnf .gram}
comment : block_comment | line_comment ;
block_comment : "/*" block_comment_body * '*' + '/' ;
block_comment_body : (block_comment | character) * ;
block_comment_body : [block_comment | character] * ;
line_comment : "//" non_eol * ;
~~~~

Expand Down Expand Up @@ -497,16 +497,16 @@ All of the above extensions are expressions with values.
## Macros

~~~~ {.notrust .ebnf .gram}
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')'
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';'
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ;
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ;
matcher : '(' matcher * ')' | '[' matcher * ']'
| '{' matcher * '}' | '$' ident ':' ident
| '$' '(' matcher * ')' sep_token? [ '*' | '+' ]
| non_special_token
| non_special_token ;
transcriber : '(' transcriber * ')' | '[' transcriber * ']'
| '{' transcriber * '}' | '$' ident
| '$' '(' transcriber * ')' sep_token? [ '*' | '+' ]
| non_special_token
| non_special_token ;
~~~~

User-defined syntax extensions are called "macros",
Expand Down Expand Up @@ -803,7 +803,7 @@ use_decl : "pub" ? "use" ident [ '=' path
path_glob : ident [ "::" path_glob ] ?
| '*'
| '{' ident [ ',' ident ] * '}'
| '{' ident [ ',' ident ] * '}' ;
~~~~

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

~~~~ {.notrust .ebnf .gram}
extern_block_item : "extern" '{' extern_block '} ;
extern_block_item : "extern" '{' extern_block '}' ;
extern_block : [ foreign_fn ] * ;
~~~~

Expand Down Expand Up @@ -1684,7 +1684,7 @@ import public items from their destination, not private items.

~~~~ {.notrust .ebnf .gram}
attribute : '#' '[' attr_list ']' ;
attr_list : attr [ ',' attr_list ]*
attr_list : attr [ ',' attr_list ]* ;
attr : ident [ '=' literal
| '(' attr_list ')' ] ? ;
~~~~
Expand Down Expand Up @@ -2332,7 +2332,7 @@ struct_expr : expr_path '{' ident ':' expr
[ ".." expr ] '}' |
expr_path '(' expr
[ ',' expr ] * ')' |
expr_path
expr_path ;
~~~~

There are several forms of structure expressions.
Expand Down Expand Up @@ -2383,7 +2383,7 @@ Point3d {y: 0, z: 10, .. base};
~~~~ {.notrust .ebnf .gram}
block_expr : '{' [ view_item ] *
[ stmt ';' | item ] *
[ expr ] '}'
[ expr ] '}' ;
~~~~

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

~~~~ {.notrust .ebnf .gram}
field_expr : expr '.' ident
field_expr : expr '.' ident ;
~~~~

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

~~~~ {.notrust .ebnf .gram}
vec_expr : '[' "mut" ? vec_elems? ']'
vec_expr : '[' "mut" ? vec_elems? ']' ;
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
~~~~

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

~~~~ {.notrust .ebnf .gram}
idx_expr : expr '[' expr ']'
idx_expr : expr '[' expr ']' ;
~~~~

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

5 comments on commit fdfb9eb

@bors
Copy link
Contributor

@bors bors commented on fdfb9eb Mar 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at jankobler@fdfb9eb

@bors
Copy link
Contributor

@bors bors commented on fdfb9eb Mar 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jankobler/rust/verify-grammar-02 = fdfb9eb into auto

@bors
Copy link
Contributor

@bors bors commented on fdfb9eb Mar 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jankobler/rust/verify-grammar-02 = fdfb9eb merged ok, testing candidate = 8610e4a

@bors
Copy link
Contributor

@bors bors commented on fdfb9eb Mar 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on fdfb9eb Mar 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 8610e4a

Please sign in to comment.