mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Constants at file-level.
This commit is contained in:
@@ -7,7 +7,7 @@ options { tokenVocab=SolidityLexer; }
|
||||
|
||||
/**
|
||||
* On top level, Solidity allows pragmas, import directives, and
|
||||
* definitions of contracts, interfaces, libraries, structs and enums.
|
||||
* definitions of contracts, interfaces, libraries, structs, enums and constants.
|
||||
*/
|
||||
sourceUnit: (
|
||||
pragmaDirective
|
||||
@@ -16,6 +16,7 @@ sourceUnit: (
|
||||
| interfaceDefinition
|
||||
| libraryDefinition
|
||||
| functionDefinition
|
||||
| constantVariableDeclaration
|
||||
| structDefinition
|
||||
| enumDefinition
|
||||
)* EOF;
|
||||
@@ -240,6 +241,17 @@ locals [boolean constantnessSet = false, boolean visibilitySet = false, boolean
|
||||
(Assign initialValue=expression)?
|
||||
Semicolon;
|
||||
|
||||
/**
|
||||
* The declaration of a constant variable.
|
||||
*/
|
||||
constantVariableDeclaration
|
||||
:
|
||||
type=typeName
|
||||
Constant
|
||||
name=identifier
|
||||
Assign initialValue=expression
|
||||
Semicolon;
|
||||
|
||||
/**
|
||||
* Parameter of an event.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user