aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2016-12-25 00:10:51 +0800
committerGitHub <noreply@github.com>2016-12-25 00:10:51 +0800
commit507525be5f3fec5860d226010beea6550373fd0b (patch)
tree4a475efa943bc1b5d00e8e3466a6cd9f52282973
parent2a7b01982c2b49399b9ee0dd89c7827af28c6280 (diff)
downloaddexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar.gz
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar.bz2
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar.lz
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar.xz
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.tar.zst
dexon-solidity-507525be5f3fec5860d226010beea6550373fd0b.zip
Fix NumberLiteral rule for hex numbers
-rw-r--r--docs/grammar.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt
index 7bb45bba..5fac96a1 100644
--- a/docs/grammar.txt
+++ b/docs/grammar.txt
@@ -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