Skip to content

4.2. Declaration Statements#

Syntax#


TupleDeconstructionStatement = (* var_keyword: *) VAR_KEYWORD? (* Deprecated in 0.5.0 *)
(* open_paren: *) OPEN_PAREN
(* elements: *) TupleDeconstructionElements
(* close_paren: *) CLOSE_PAREN
(* equal: *) EQUAL
(* expression: *) Expression
(* semicolon: *) SEMICOLON;

TupleDeconstructionElements = (* item: *) TupleDeconstructionElement ((* separator: *) COMMA (* item: *) TupleDeconstructionElement)*;

TupleDeconstructionElement = (* member: *) TupleMember?;

TupleMember = (* variant: *) TypedTupleMember
| (* variant: *) UntypedTupleMember;

TypedTupleMember = (* type_name: *) TypeName
(* storage_location: *) StorageLocation?
(* name: *) IDENTIFIER;

UntypedTupleMember = (* storage_location: *) StorageLocation?
(* name: *) IDENTIFIER;

VariableDeclarationStatement = (* variable_type: *) VariableDeclarationType
(* storage_location: *) StorageLocation?
(* name: *) IDENTIFIER
(* value: *) VariableDeclarationValue?
(* semicolon: *) SEMICOLON;

VariableDeclarationType = (* variant: *) TypeName
| (* variant: *) VAR_KEYWORD; (* Deprecated in 0.5.0 *)

VariableDeclarationValue = (* equal: *) EQUAL
(* expression: *) Expression;

StorageLocation = (* variant: *) MEMORY_KEYWORD
| (* variant: *) STORAGE_KEYWORD
| (* variant: *) CALL_DATA_KEYWORD; (* Introduced in 0.5.0 *)

Documentation#

Note

This section is under construction. You are more than welcome to contribute suggestions to our GitHub repository.