diff --git a/docs/grammar/README.md b/docs/grammar/README.md index b2226f3fb3..1e10756188 100644 --- a/docs/grammar/README.md +++ b/docs/grammar/README.md @@ -204,12 +204,6 @@ hexadecimal-digit = decimal-digit / "a" / "b" / "c" / "d" / "e" / "f" Go to: _[decimal-digit](#user-content-decimal-digit)_; -An identifier is a non-empty sequence of -letters, (decimal) digits, and underscores, -starting with a letter. -It must not be a keyword or a boolean literal, -and it must not be or start with `aleo1`; -these are extra-grammatical requirements, indicated in the comment. ```abnf identifier = letter *( letter / decimal-digit / "_" ) @@ -485,6 +479,7 @@ scalar-type = boolean-type / arithmetic-type / address-type / character-type Go to: _[address-type](#user-content-address-type), [arithmetic-type](#user-content-arithmetic-type), [boolean-type](#user-content-boolean-type), [character-type](#user-content-character-type)_; + ```abnf type = scalar-type @@ -530,9 +525,10 @@ Go to: _[affine-group-literal](#user-content-affine-group-literal), [product-gro primary-expression = identifier / literal / "(" expression ")" + / identifier function-arguments ``` -Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier), [literal](#user-content-literal)_; +Go to: _[expression](#user-content-expression), [function-arguments](#user-content-function-arguments), [identifier](#user-content-identifier), [literal](#user-content-literal)_; @@ -543,23 +539,14 @@ function-arguments = "(" [ expression *( "," expression ) [ "," ] ] ")" Go to: _[expression](#user-content-expression)_; - -```abnf -postfix-expression = primary-expression - / identifier function-arguments -``` - -Go to: _[function-arguments](#user-content-function-arguments), [identifier](#user-content-identifier), [primary-expression](#user-content-primary-expression)_; - - ```abnf -unary-expression = postfix-expression +unary-expression = primary-expression / "!" unary-expression / "-" unary-expression ``` -Go to: _[postfix-expression](#user-content-postfix-expression), [unary-expression](#user-content-unary-expression)_; +Go to: _[primary-expression](#user-content-primary-expression), [unary-expression](#user-content-unary-expression)_; @@ -787,6 +774,7 @@ print-call = print-function print-arguments Go to: _[print-arguments](#user-content-print-arguments), [print-function](#user-content-print-function)_; + ```abnf function-declaration = %s"function" identifier diff --git a/docs/grammar/abnf-grammar.txt b/docs/grammar/abnf-grammar.txt index 490bc9e945..21830a6f50 100644 --- a/docs/grammar/abnf-grammar.txt +++ b/docs/grammar/abnf-grammar.txt @@ -100,12 +100,6 @@ octal-digit = %x30-37 ; 0-7 hexadecimal-digit = decimal-digit / "a" / "b" / "c" / "d" / "e" / "f" -; An identifier is a non-empty sequence of -; letters, (decimal) digits, and underscores, -; starting with a letter. -; It must not be a keyword or a boolean literal, -; and it must not be or start with `aleo1`; -; these are extra-grammatical requirements, indicated in the comment. identifier = letter *( letter / decimal-digit / "_" ) ; but not a keyword or a boolean literal or aleo1... @@ -228,13 +222,11 @@ group-literal = product-group-literal / affine-group-literal primary-expression = identifier / literal / "(" expression ")" + / identifier function-arguments function-arguments = "(" [ expression *( "," expression ) [ "," ] ] ")" -postfix-expression = primary-expression - / identifier function-arguments - -unary-expression = postfix-expression +unary-expression = primary-expression / "!" unary-expression / "-" unary-expression