aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-28 07:21:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-03-28 07:21:42 +0800
commit558de3d9adc3b2ea1403ef995ea46dfad6ca0bdd (patch)
tree48adc5842cbeb1843f60f5e6331faca5eff83edb
parent07f048a8d764b075cb73dca4002b4743841faaa9 (diff)
downloadrneovim-558de3d9adc3b2ea1403ef995ea46dfad6ca0bdd.tar.gz
rneovim-558de3d9adc3b2ea1403ef995ea46dfad6ca0bdd.tar.bz2
rneovim-558de3d9adc3b2ea1403ef995ea46dfad6ca0bdd.zip
vim-patch:052b86b: runtime(solidity): update syntax script with error definitions
closes: vim/vim#16978 References: - https://docs.soliditylang.org/en/latest/contracts.html#transient-storage - https://soliditylang.org/blog/2021/04/21/custom-errors/ https://github.com/vim/vim/commit/052b86ba6315e65eb034ac906128f9bd82d5f2d7 Co-authored-by: S0AndS0 <strangerthanbland@gmail.com>
-rw-r--r--runtime/syntax/solidity.vim14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/syntax/solidity.vim b/runtime/syntax/solidity.vim
index a46d041a10..5391bba707 100644
--- a/runtime/syntax/solidity.vim
+++ b/runtime/syntax/solidity.vim
@@ -2,10 +2,11 @@
" Language: Solidity
" Maintainer: Cothi (jiungdev@gmail.com)
" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
-" Last Change: 2022 Sep 27
+" Last Change: 2025 Mar 25
"
" Contributors:
" Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim)
+" Modified by S0AndS0 (https://github.com/S0AndS0/vim/blob/syntax-solidity-updates/runtime/syntax/solidity.vim)
if exists("b:current_syntax")
finish
@@ -15,7 +16,7 @@ endif
syn keyword solKeyword abstract anonymous as break calldata case catch constant constructor continue default switch revert require
syn keyword solKeyword ecrecover addmod mulmod keccak256
syn keyword solKeyword delete do else emit enum external final for function if immutable import in indexed inline
-syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual
+syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual transient
syn keyword solKeyword relocatable return returns static storage struct throw try type typeof using
syn keyword solKeyword var view while
@@ -158,6 +159,15 @@ hi def link solEvent Type
hi def link solEventName Function
hi def link solEventArgSpecial Label
+" Error
+syn match solError /\<error\>/ nextgroup=solErrorName,solErrorArgs skipwhite
+syn match solErrorName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solErrorArgs skipwhite
+syn region solErrorArgs contained matchgroup=solFuncParens start='(' end=')' contains=solErrorArgCommas,solBuiltinType skipwhite skipempty
+syn match solErrorArgCommas contained ','
+
+hi def link solError Type
+hi def link solErrorName Function
+
" Comment
syn keyword solCommentTodo TODO FIXME XXX TBD contained
syn match solNatSpec contained /@title\|@author\|@notice\|@dev\|@param\|@inheritdoc\|@return/