7
|
1 " Vim syntax file
|
|
2 " Language: Sather/pSather
|
|
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
|
4 " URL: http://www.fleiner.com/vim/syntax/sather.vim
|
|
5 " Last Change: 2003 May 11
|
|
6
|
|
7 " Sather is a OO-language developped at the International Computer Science
|
|
8 " Institute (ICSI) in Berkeley, CA. pSather is a parallel extension to Sather.
|
|
9 " Homepage: http://www.icsi.berkeley.edu/~sather
|
|
10 " Sather files use .sa as suffix
|
|
11
|
|
12 " For version 5.x: Clear all syntax items
|
|
13 " For version 6.x: Quit when a syntax file was already loaded
|
|
14 if version < 600
|
|
15 syntax clear
|
|
16 elseif exists("b:current_syntax")
|
|
17 finish
|
|
18 endif
|
|
19
|
|
20 " keyword definitions
|
|
21 syn keyword satherExternal extern
|
|
22 syn keyword satherBranch break continue
|
|
23 syn keyword satherLabel when then
|
|
24 syn keyword satherConditional if else elsif end case typecase assert with
|
|
25 syn match satherConditional "near$"
|
|
26 syn match satherConditional "far$"
|
|
27 syn match satherConditional "near *[^(]"he=e-1
|
|
28 syn match satherConditional "far *[^(]"he=e-1
|
|
29 syn keyword satherSynchronize lock guard sync
|
|
30 syn keyword satherRepeat loop parloop do
|
|
31 syn match satherRepeat "while!"
|
|
32 syn match satherRepeat "break!"
|
|
33 syn match satherRepeat "until!"
|
|
34 syn keyword satherBoolValue true false
|
|
35 syn keyword satherValue self here cluster
|
|
36 syn keyword satherOperator new "== != & ^ | && ||
|
|
37 syn keyword satherOperator and or not
|
|
38 syn match satherOperator "[#!]"
|
|
39 syn match satherOperator ":-"
|
|
40 syn keyword satherType void attr where
|
|
41 syn match satherType "near *("he=e-1
|
|
42 syn match satherType "far *("he=e-1
|
|
43 syn keyword satherStatement return
|
|
44 syn keyword satherStorageClass static const
|
|
45 syn keyword satherExceptions try raise catch
|
|
46 syn keyword satherMethodDecl is pre post
|
|
47 syn keyword satherClassDecl abstract value class include
|
|
48 syn keyword satherScopeDecl public private readonly
|
|
49
|
|
50
|
|
51 syn match satherSpecial contained "\\\d\d\d\|\\."
|
|
52 syn region satherString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=satherSpecial
|
|
53 syn match satherCharacter "'[^\\]'"
|
|
54 syn match satherSpecialCharacter "'\\.'"
|
|
55 syn match satherNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
|
56 syn match satherCommentSkip contained "^\s*\*\($\|\s\+\)"
|
|
57 syn region satherComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+$\|"+ contains=satherSpecial
|
|
58 syn match satherComment "--.*" contains=satherComment2String,satherCharacter,satherNumber
|
|
59
|
|
60
|
|
61 syn sync ccomment satherComment
|
|
62
|
|
63 " Define the default highlighting.
|
|
64 " For version 5.7 and earlier: only when not done already
|
|
65 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
66 if version >= 508 || !exists("did_sather_syn_inits")
|
|
67 if version < 508
|
|
68 let did_sather_syn_inits = 1
|
|
69 command -nargs=+ HiLink hi link <args>
|
|
70 else
|
|
71 command -nargs=+ HiLink hi def link <args>
|
|
72 endif
|
|
73
|
|
74 HiLink satherBranch satherStatement
|
|
75 HiLink satherLabel satherStatement
|
|
76 HiLink satherConditional satherStatement
|
|
77 HiLink satherSynchronize satherStatement
|
|
78 HiLink satherRepeat satherStatement
|
|
79 HiLink satherExceptions satherStatement
|
|
80 HiLink satherStorageClass satherDeclarative
|
|
81 HiLink satherMethodDecl satherDeclarative
|
|
82 HiLink satherClassDecl satherDeclarative
|
|
83 HiLink satherScopeDecl satherDeclarative
|
|
84 HiLink satherBoolValue satherValue
|
|
85 HiLink satherSpecial satherValue
|
|
86 HiLink satherString satherValue
|
|
87 HiLink satherCharacter satherValue
|
|
88 HiLink satherSpecialCharacter satherValue
|
|
89 HiLink satherNumber satherValue
|
|
90 HiLink satherStatement Statement
|
|
91 HiLink satherOperator Statement
|
|
92 HiLink satherComment Comment
|
|
93 HiLink satherType Type
|
|
94 HiLink satherValue String
|
|
95 HiLink satherString String
|
|
96 HiLink satherSpecial String
|
|
97 HiLink satherCharacter String
|
|
98 HiLink satherDeclarative Type
|
|
99 HiLink satherExternal PreCondit
|
|
100 delcommand HiLink
|
|
101 endif
|
|
102
|
|
103 let b:current_syntax = "sather"
|
|
104
|
|
105 " vim: ts=8
|