Merge pull request #1927 from AleoHQ/abnf-tuples

[ABNF] Add tuples.
This commit is contained in:
Collin Chin 2022-07-11 15:16:44 -07:00 committed by GitHub
commit de23832673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,7 +235,9 @@ primitive-type = boolean-type / arithmetic-type / address-type / string-type
named-type = primitive-type / identifier
type = named-type
tuple-type = "(" [ type 1*( "," type ) [ "," ] ] ")"
type = named-type / tuple-type
group-coordinate = ( [ "-" ] numeral ) / "+" / "-" / "_"
@ -251,6 +253,7 @@ primary-expression = literal
/ "(" expression ")"
/ free-function-call
/ static-function-call
/ tuple-expression
/ circuit-expression
variable-or-free-constant = identifier
@ -263,6 +266,8 @@ static-function-call = named-type "::" identifier function-arguments
function-arguments = "(" [ expression *( "," expression ) [ "," ] ] ")"
tuple-expression = "(" [ expression 1*( "," expression ) [ "," ] ] ")"
circuit-expression = identifier "{" circuit-component-initializer
*( "," circuit-component-initializer )
[ "," ] "}"
@ -271,9 +276,12 @@ circuit-component-initializer = identifier
/ identifier ":" expression
postfix-expression = primary-expression
/ tuple-component-expression
/ circuit-component-expression
/ operator-call
tuple-component-expression = postfix-expression "." numeral
circuit-component-expression = postfix-expression "." identifier
operator-call = unary-operator-call / binary-operator-call