From 029f72b1a93430b24b88eb3a72c6114d9f149737 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:09:20 +0200 Subject: Adding upstream version 2:9.1.0016. Signed-off-by: Daniel Baumann --- runtime/syntax/st.vim | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 runtime/syntax/st.vim (limited to 'runtime/syntax/st.vim') diff --git a/runtime/syntax/st.vim b/runtime/syntax/st.vim new file mode 100644 index 0000000..ffa7820 --- /dev/null +++ b/runtime/syntax/st.vim @@ -0,0 +1,95 @@ +" Vim syntax file +" Language: Smalltalk +" Maintainer: Arndt Hesse +" Last Change: 2012 Feb 12 by Thilo Six + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" some Smalltalk keywords and standard methods +syn keyword stKeyword super self class true false new not +syn keyword stKeyword notNil isNil inspect out nil +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" +syn match stMethod "\:" + +" the block of local variables of a method +syn region stLocalVariables start="^[ \t]*|" end="|" + +" the Smalltalk comment +syn region stComment start="\"" end="\"" + +" the Smalltalk strings and single characters +syn region stString start='\'' skip="''" end='\'' +syn match stCharacter "$." + +syn case ignore + +" the symbols prefixed by a '#' +syn match stSymbol "\(#\<[a-z_][a-z0-9_]*\>\)" +syn match stSymbol "\(#'[^']*'\)" + +" the variables in a statement block for loops +syn match stBlockVariable "\(:[ \t]*\<[a-z_][a-z0-9_]*\>[ \t]*\)\+|" contained + +" some representations of numbers +syn match stNumber "\<\d\+\(u\=l\=\|lu\|f\)\>" +syn match stFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" +syn match stFloat "\<\d\+e[-+]\=\d\+[fl]\=\>" + +syn case match + +" a try to highlight paren mismatches +syn region stParen transparent start='(' end=')' contains=ALLBUT,stParenError +syn match stParenError ")" +syn region stBlock transparent start='\[' end='\]' contains=ALLBUT,stBlockError +syn match stBlockError "\]" +syn region stSet transparent start='{' end='}' contains=ALLBUT,stSetError +syn match stSetError "}" + +hi link stParenError stError +hi link stSetError stError +hi link stBlockError stError + +" synchronization for syntax analysis +syn sync minlines=50 + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +hi def link stKeyword Statement +hi def link stMethod Statement +hi def link stComment Comment +hi def link stCharacter Constant +hi def link stString Constant +hi def link stSymbol Special +hi def link stNumber Type +hi def link stFloat Type +hi def link stError Error +hi def link stLocalVariables Identifier +hi def link stBlockVariable Identifier + + +let b:current_syntax = "st" + +let &cpo = s:cpo_save +unlet s:cpo_save -- cgit v1.2.3