Skip to content

Commit d68fdfc

Browse files
authored
Merge pull request #16 from lazyledger/adlerjohn-forbid_additional_keywords
Add additional forbidden keywords
2 parents 860d194 + c5cfa0d commit d68fdfc

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

generator/generator.go

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,48 @@ func checkSyntaxVersion(v string) error {
931931
}
932932

933933
func checkKeyword(w string) error {
934+
// https://solidity.readthedocs.io/en/v0.6.12/cheatsheet.html
935+
934936
switch w {
935-
case "after",
937+
case
938+
// Global Variables
939+
"abi",
940+
"block",
941+
"gasleft",
942+
"msg",
943+
"now",
944+
"tx",
945+
"assert",
946+
"require",
947+
"revert",
948+
"blockhash",
949+
"keccak256",
950+
"sha256",
951+
"ripemd160",
952+
"ecrecover",
953+
"addmod",
954+
"mulmod",
955+
"this",
956+
"super",
957+
"selfdestruct",
958+
"type",
959+
// Function Visibility Specifiers
960+
"public",
961+
"private",
962+
"external",
963+
"internal",
964+
// Modifiers
965+
"pure",
966+
"view",
967+
"payable",
968+
"constant",
969+
"immutable",
970+
"anonymous",
971+
"indexed",
972+
"virtual",
973+
"override",
974+
// Reserved Keywords
975+
"after",
936976
"alias",
937977
"apply",
938978
"auto",
@@ -941,7 +981,6 @@ func checkKeyword(w string) error {
941981
"default",
942982
"define",
943983
"final",
944-
"immutable",
945984
"implements",
946985
"in",
947986
"inline",

0 commit comments

Comments
 (0)