Merge pull request #1189 from NicolaiSoeborg/develop

Add HexLiteral to grammar, fixes #1186
This commit is contained in:
chriseth 2016-10-10 23:41:55 +02:00 committed by GitHub
commit d3f410d8a8

View File

@ -77,7 +77,7 @@ Expression =
| Expression? (',' Expression)
| PrimaryExpression
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | HexLiteral | StringLiteral
FunctionCall = ( PrimaryExpression | NewExpression | TypeName ) ( ( '.' Identifier ) | ( '[' Expression ']' ) )* '(' Expression? ( ',' Expression )* ')'
NewExpression = 'new' Identifier
@ -88,8 +88,8 @@ BooleanLiteral = 'true' | 'false'
NumberLiteral = '0x'? [0-9]+ (' ' 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]*
ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'