aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-12-27 17:59:28 +0800
committerGitHub <noreply@github.com>2016-12-27 17:59:28 +0800
commiteafd852a766645da0cb466bff681b9bbb1d6da00 (patch)
tree6dec744b985830dbfd2622c223626be50744b1a1
parent3a88580512f6cb5f3305c371bbbdda8e47f44687 (diff)
parent890a8818b5455eb067b5ee2ed6c9d32623c0c94c (diff)
downloaddexon-solidity-eafd852a766645da0cb466bff681b9bbb1d6da00.tar.gz
dexon-solidity-eafd852a766645da0cb466bff681b9bbb1d6da00.tar.zst
dexon-solidity-eafd852a766645da0cb466bff681b9bbb1d6da00.zip
Merge pull request #1522 from federicobond/patch-2
Fix some grammar.txt inconsistencies
-rw-r--r--docs/grammar.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt
index d15fbaf7..c9f7f448 100644
--- a/docs/grammar.txt
+++ b/docs/grammar.txt
@@ -23,7 +23,7 @@ StructDefinition = 'struct' Identifier '{'
ModifierDefinition = 'modifier' Identifier ParameterList? Block
FunctionDefinition = 'function' Identifier? ParameterList
( FunctionCall | Identifier | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )*
- ( 'returns' ParameterList )? Block
+ ( 'returns' ParameterList )? ( ';' | Block )
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
EnumValue = Identifier
@@ -38,7 +38,7 @@ TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'
VariableDeclaration = TypeName Identifier
TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName | FunctionTypeName
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
-ArrayTypeName = TypeName StorageLocation? '[' Expression? ']'
+ArrayTypeName = TypeName '[' Expression? ']' StorageLocation?
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' | 'payable' )*
( 'returns' TypeNameList )?
StorageLocation = 'memory' | 'storage'
@@ -90,13 +90,16 @@ MemberAccess = Expression '.' Identifier
IndexAccess = Expression '[' Expression? ']'
BooleanLiteral = 'true' | 'false'
-NumberLiteral = '0x'? [0-9]+ (' ' NumberUnit)?
+NumberLiteral = ( HexNumber | DecimalNumber ) (' ' NumberUnit)?
NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether'
| 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years'
HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'')
StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
Identifier = [a-zA-Z_] [a-zA-Z_0-9]*
+HexNumber = '0x' [0-9a-fA-F]+
+DecimalNumber = [0-9]+
+
ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'
| Int | Uint | Byte | Fixed | Ufixed