8000 runtime(solidity): update syntax script with error definitions · macvim-dev/macvim@052b86b · GitHub
[go: up one dir, main page]

Skip to content

Commit 052b86b

Browse files
S0AndS0chrisbra
authored andcommitted
runtime(solidity): update syntax script with error definitions
closes: #16978 References: - https://docs.soliditylang.org/en/latest/contracts.html#transient-storage - https://soliditylang.org/blog/2021/04/21/custom-errors/ Signed-off-by: S0AndS0 <strangerthanbland@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 721be7f commit 052b86b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

runtime/syntax/solidity.vim

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
" Language: Solidity
33
" Maintainer: Cothi (jiungdev@gmail.com)
44
" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
5-
" Last Change: 2022 Sep 27
5+
" Last Change: 2025 Mar 25
66
"
77
" Contributors:
88
" Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim)
9+
" Modified by S0AndS0 (https://github.com/S0AndS0/vim/blob/syntax-solidity-updates/runtime/syntax/solidity.vim)
910

1011
if exists("b:current_syntax")
1112
finish
@@ -15,7 +16,7 @@ endif
1516
syn keyword solKeyword abstract anonymous as break calldata case catch constant constructor continue default switch revert require
1617
syn keyword solKeyword ecrecover addmod mulmod keccak256
1718
syn keyword solKeyword delete do else emit enum external final for function if immutable import in indexed inline
18-
syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual
19+
syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual transient
1920
syn keyword solKeyword relocatable return returns static storage struct throw try type typeof using
2021
syn keyword solKeyword var view while
2122

@@ -158,6 +159,15 @@ hi def link solEvent Type
158159
hi def link solEventName Function
159160
hi def link solEventArgSpecial Label
160161

162+
" Error
163+
syn match solError /\<error\>/ nextgroup=solErrorName,solErrorArgs skipwhite
164+
syn match solErrorName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solErrorArgs skipwhite
165+
syn region solErrorArgs contained matchgroup=solFuncParens start='(' end=')' contains=solErrorArgCommas,solBuiltinType skipwhite skipempty
166+
syn match solErrorArgCommas contained ','
167+
168+
hi def link solError Type
169+
hi def link solErrorName Function
170+
161171
" Comment
162172
syn keyword solCommentTodo TODO FIXME XXX TBD contained
163173
syn match solNatSpec contained /@title\|@author\|@notice\|@dev\|@param\|@inheritdoc\|@return/

0 commit comments

Comments
 (0)
0