From cbca3fd893118adb2c26c95e7b383701b5cb8a92 Mon Sep 17 00:00:00 2001 From: Diep Pham Date: Sat, 28 Apr 2018 21:59:50 +0700 Subject: [PATCH] adds constructor as keyword From solidity v0.4.22 change log: https://github.com/ethereum/solidity/releases/tag/v0.4.22 > Constructors should now be defined using constructor(uint arg1, uint arg2) { ... } to make them stand out and avoid bugs when contracts are renamed but not their constructors. --- changelog.MD | 2 ++ solidity-mode.el | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/changelog.MD b/changelog.MD index 85397cc..2547bcf 100644 --- a/changelog.MD +++ b/changelog.MD @@ -8,6 +8,8 @@ The changelog starts from version 0.1.4 as too much was added in each version be - Fixed flycheck integration doesn't search for solc and solium in PATH. +- Add `constructor` as keyword. + ## Version 0.1.9 - Integrated [company-solidity](https://github.com/ssmolkin1/company-solidity) into solidity-mode, providing autocompletion out of the box if the user has [company-mode](http://company-mode.github.io) installed. diff --git a/solidity-mode.el b/solidity-mode.el index 8ee0f3e..3ae5323 100644 --- a/solidity-mode.el +++ b/solidity-mode.el @@ -83,11 +83,13 @@ Possible values are: (defconst solidity-keywords '("after" + "anonymous" "as" "assembly" + "assert" "break" "constant" - "anonymous" + "constructor" "continue" "contract" "default" @@ -95,6 +97,7 @@ Possible values are: "do" "else" "emit" + "enum" "event" "external" "for" @@ -102,34 +105,32 @@ Possible values are: "if" "import" "in" - "is" "indexed" "interface" + "internal" + "is" "library" "mapping" + "memory" "modifier" "new" "pragma" "private" "public" - "internal" "pure" - "view" + "require" "return" "returns" + "revert" + "storage" "struct" "switch" "this" + "throw" "using" "var" + "view" "while" - "enum" - "throw" - "assert" - "require" - "revert" - "storage" - "memory" ) "Keywords of the solidity language.")