7
|
1 " Vim syntax file
|
|
2 " Language: Smalltalk
|
|
3 " Maintainer: Arndt Hesse <hesse@self.de>
|
|
4 " Last Change: 2001 May 09
|
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 " some Smalltalk keywords and standard methods
|
|
15 syn keyword stKeyword super self class true false new not
|
|
16 syn keyword stKeyword notNil isNil inspect out nil
|
|
17 syn match stMethod "\<do\>:"
|
|
18 syn match stMethod "\<whileTrue\>:"
|
|
19 syn match stMethod "\<whileFalse\>:"
|
|
20 syn match stMethod "\<ifTrue\>:"
|
|
21 syn match stMethod "\<ifFalse\>:"
|
|
22 syn match stMethod "\<put\>:"
|
|
23 syn match stMethod "\<to\>:"
|
|
24 syn match stMethod "\<at\>:"
|
|
25 syn match stMethod "\<add\>:"
|
|
26 syn match stMethod "\<new\>:"
|
|
27 syn match stMethod "\<for\>:"
|
|
28 syn match stMethod "\<methods\>:"
|
|
29 syn match stMethod "\<methodsFor\>:"
|
|
30 syn match stMethod "\<instanceVariableNames\>:"
|
|
31 syn match stMethod "\<classVariableNames\>:"
|
|
32 syn match stMethod "\<poolDictionaries\>:"
|
|
33 syn match stMethod "\<subclass\>:"
|
|
34
|
|
35 " the block of local variables of a method
|
|
36 syn region stLocalVariables start="^[ \t]*|" end="|"
|
|
37
|
|
38 " the Smalltalk comment
|
|
39 syn region stComment start="\"" end="\""
|
|
40
|
|
41 " the Smalltalk strings and single characters
|
|
42 syn region stString start='\'' skip="''" end='\''
|
|
43 syn match stCharacter "$."
|
|
44
|
|
45 syn case ignore
|
|
46
|
|
47 " the symols prefixed by a '#'
|
|
48 syn match stSymbol "\(#\<[a-z_][a-z0-9_]*\>\)"
|
|
49 syn match stSymbol "\(#'[^']*'\)"
|
|
50
|
|
51 " the variables in a statement block for loops
|
|
52 syn match stBlockVariable "\(:[ \t]*\<[a-z_][a-z0-9_]*\>[ \t]*\)\+|" contained
|
|
53
|
|
54 " some representations of numbers
|
|
55 syn match stNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
|
|
56 syn match stFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
|
|
57 syn match stFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
|
|
58
|
|
59 syn case match
|
|
60
|
|
61 " a try to higlight paren mismatches
|
|
62 syn region stParen transparent start='(' end=')' contains=ALLBUT,stParenError
|
|
63 syn match stParenError ")"
|
|
64 syn region stBlock transparent start='\[' end='\]' contains=ALLBUT,stBlockError
|
|
65 syn match stBlockError "\]"
|
|
66 syn region stSet transparent start='{' end='}' contains=ALLBUT,stSetError
|
|
67 syn match stSetError "}"
|
|
68
|
|
69 hi link stParenError stError
|
|
70 hi link stSetError stError
|
|
71 hi link stBlockError stError
|
|
72
|
|
73 " synchronization for syntax analysis
|
|
74 syn sync minlines=50
|
|
75
|
|
76 " Define the default highlighting.
|
|
77 " For version 5.7 and earlier: only when not done already
|
|
78 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
79 if version >= 508 || !exists("did_st_syntax_inits")
|
|
80 if version < 508
|
|
81 let did_st_syntax_inits = 1
|
|
82 command -nargs=+ HiLink hi link <args>
|
|
83 else
|
|
84 command -nargs=+ HiLink hi def link <args>
|
|
85 endif
|
|
86
|
|
87 HiLink stKeyword Statement
|
|
88 HiLink stMethod Statement
|
|
89 HiLink stComment Comment
|
|
90 HiLink stCharacter Constant
|
|
91 HiLink stString Constant
|
|
92 HiLink stSymbol Special
|
|
93 HiLink stNumber Type
|
|
94 HiLink stFloat Type
|
|
95 HiLink stError Error
|
|
96 HiLink stLocalVariables Identifier
|
|
97 HiLink stBlockVariable Identifier
|
|
98
|
|
99 delcommand HiLink
|
|
100 endif
|
|
101
|
|
102 let b:current_syntax = "st"
|