Allow underscore separators in number and bytes literals

For instance, `1_000_000_000` or `#FFFF_FFFF_FFFF_FFFF`
This commit is contained in:
Ulf Norell
2019-09-23 14:04:09 +02:00
parent a21715a657
commit f81dc88526
3 changed files with 32 additions and 9 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ compilable_contracts() ->
"manual_stdlib_include",
"list_comp",
"payable",
"unapplied_builtins"
"unapplied_builtins",
"underscore_number_literals"
].
not_yet_compilable(fate) -> [];
@@ -0,0 +1,13 @@
contract UnderscoreNumberLiterals =
entrypoint ints() : list(int) =
[ 1_999_000_000,
19_99_00_00_00,
0xfff_FFF_010 ]
entrypoint bytes() : list(bytes(4)) =
[ #abcd_ef_00,
#01_02_03_04,
#aaaa_FFFF ]