codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Smalltalk3" Maintainer: Arndt Hesse <hesse@self.de>4" Last Change: 2012 Feb 12 by Thilo Six5 6" quit when a syntax file was already loaded7if exists("b:current_syntax")8 finish9endif10 11let s:cpo_save = &cpo12set cpo&vim13 14" some Smalltalk keywords and standard methods15syn keyword stKeyword super self class true false new not16syn keyword stKeyword notNil isNil inspect out nil17syn match stMethod "\<do\>:"18syn match stMethod "\<whileTrue\>:"19syn match stMethod "\<whileFalse\>:"20syn match stMethod "\<ifTrue\>:"21syn match stMethod "\<ifFalse\>:"22syn match stMethod "\<put\>:"23syn match stMethod "\<to\>:"24syn match stMethod "\<at\>:"25syn match stMethod "\<add\>:"26syn match stMethod "\<new\>:"27syn match stMethod "\<for\>:"28syn match stMethod "\<methods\>:"29syn match stMethod "\<methodsFor\>:"30syn match stMethod "\<instanceVariableNames\>:"31syn match stMethod "\<classVariableNames\>:"32syn match stMethod "\<poolDictionaries\>:"33syn match stMethod "\<subclass\>:"34 35" the block of local variables of a method36syn region stLocalVariables start="^[ \t]*|" end="|"37 38" the Smalltalk comment39syn region stComment start="\"" end="\""40 41" the Smalltalk strings and single characters42syn region stString start='\'' skip="''" end='\''43syn match stCharacter "$."44 45syn case ignore46 47" the symbols prefixed by a '#'48syn match stSymbol "\(#\<[a-z_][a-z0-9_]*\>\)"49syn match stSymbol "\(#'[^']*'\)"50 51" the variables in a statement block for loops52syn match stBlockVariable "\(:[ \t]*\<[a-z_][a-z0-9_]*\>[ \t]*\)\+|" contained53 54" some representations of numbers55syn match stNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"56syn match stFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"57syn match stFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"58 59syn case match60 61" a try to highlight paren mismatches62syn region stParen transparent start='(' end=')' contains=ALLBUT,stParenError63syn match stParenError ")"64syn region stBlock transparent start='\[' end='\]' contains=ALLBUT,stBlockError65syn match stBlockError "\]"66syn region stSet transparent start='{' end='}' contains=ALLBUT,stSetError67syn match stSetError "}"68 69hi link stParenError stError70hi link stSetError stError71hi link stBlockError stError72 73" synchronization for syntax analysis74syn sync minlines=5075 76" Define the default highlighting.77" Only when an item doesn't have highlighting yet78 79hi def link stKeyword Statement80hi def link stMethod Statement81hi def link stComment Comment82hi def link stCharacter Constant83hi def link stString Constant84hi def link stSymbol Special85hi def link stNumber Type86hi def link stFloat Type87hi def link stError Error88hi def link stLocalVariables Identifier89hi def link stBlockVariable Identifier90 91 92let b:current_syntax = "st"93 94let &cpo = s:cpo_save95unlet s:cpo_save96 