7
|
1 " Vim syntax file
|
|
2 " Language: S-Lang
|
|
3 " Maintainer: Jan Hlavacek <lahvak@math.ohio-state.edu>
|
|
4 " Last Change: 980216
|
|
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 syn keyword slangStatement break return continue EXECUTE_ERROR_BLOCK
|
|
15 syn match slangStatement "\<X_USER_BLOCK[0-4]\>"
|
|
16 syn keyword slangLabel case
|
|
17 syn keyword slangConditional !if if else switch
|
|
18 syn keyword slangRepeat while for _for loop do forever
|
|
19 syn keyword slangDefinition define typedef variable struct
|
|
20 syn keyword slangOperator or and andelse orelse shr shl xor not
|
|
21 syn keyword slangBlock EXIT_BLOCK ERROR_BLOCK
|
|
22 syn match slangBlock "\<USER_BLOCK[0-4]\>"
|
|
23 syn keyword slangConstant NULL
|
|
24 syn keyword slangType Integer_Type Double_Type Complex_Type String_Type Struct_Type Ref_Type Null_Type Array_Type DataType_Type
|
|
25
|
|
26 syn match slangOctal "\<0\d\+\>" contains=slangOctalError
|
|
27 syn match slangOctalError "[89]\+" contained
|
|
28 syn match slangHex "\<0[xX][0-9A-Fa-f]*\>"
|
|
29 syn match slangDecimal "\<[1-9]\d*\>"
|
|
30 syn match slangFloat "\<\d\+\."
|
|
31 syn match slangFloat "\<\d\+\.\d\+\([Ee][-+]\=\d\+\)\=\>"
|
|
32 syn match slangFloat "\<\d\+\.[Ee][-+]\=\d\+\>"
|
|
33 syn match slangFloat "\<\d\+[Ee][-+]\=\d\+\>"
|
|
34 syn match slangFloat "\.\d\+\([Ee][-+]\=\d\+\)\=\>"
|
|
35 syn match slangImaginary "\.\d\+\([Ee][-+]\=\d*\)\=[ij]\>"
|
|
36 syn match slangImaginary "\<\d\+\(\.\d*\)\=\([Ee][-+]\=\d\+\)\=[ij]\>"
|
|
37
|
|
38 syn region slangString oneline start='"' end='"' skip='\\"'
|
|
39 syn match slangCharacter "'[^\\]'"
|
|
40 syn match slangCharacter "'\\.'"
|
|
41 syn match slangCharacter "'\\[0-7]\{1,3}'"
|
|
42 syn match slangCharacter "'\\d\d\{1,3}'"
|
|
43 syn match slangCharacter "'\\x[0-7a-fA-F]\{1,2}'"
|
|
44
|
|
45 syn match slangDelim "[][{};:,]"
|
|
46 syn match slangOperator "[-%+/&*=<>|!~^@]"
|
|
47
|
|
48 "catch errors caused by wrong parenthesis
|
|
49 syn region slangParen matchgroup=slangDelim transparent start='(' end=')' contains=ALLBUT,slangParenError
|
|
50 syn match slangParenError ")"
|
|
51
|
|
52 syn match slangComment "%.*$"
|
|
53 syn keyword slangOperator sizeof
|
|
54
|
|
55 syn region slangPreCondit start="^\s*#\s*\(ifdef\>\|ifndef\>\|iftrue\>\|ifnfalse\>\|iffalse\>\|ifntrue\>\|if\$\|ifn\$\|\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=cComment,slangString,slangCharacter,slangNumber
|
|
56
|
|
57 " Define the default highlighting.
|
|
58 " For version 5.7 and earlier: only when not done already
|
|
59 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
60 if version >= 508 || !exists("did_slang_syntax_inits")
|
|
61 if version < 508
|
|
62 let did_slang_syntax_inits = 1
|
|
63 command -nargs=+ HiLink hi link <args>
|
|
64 else
|
|
65 command -nargs=+ HiLink hi def link <args>
|
|
66 endif
|
|
67
|
|
68 HiLink slangDefinition Type
|
|
69 HiLink slangBlock slangDefinition
|
|
70 HiLink slangLabel Label
|
|
71 HiLink slangConditional Conditional
|
|
72 HiLink slangRepeat Repeat
|
|
73 HiLink slangCharacter Character
|
|
74 HiLink slangFloat Float
|
|
75 HiLink slangImaginary Float
|
|
76 HiLink slangDecimal slangNumber
|
|
77 HiLink slangOctal slangNumber
|
|
78 HiLink slangHex slangNumber
|
|
79 HiLink slangNumber Number
|
|
80 HiLink slangParenError Error
|
|
81 HiLink slangOctalError Error
|
|
82 HiLink slangOperator Operator
|
|
83 HiLink slangStructure Structure
|
|
84 HiLink slangInclude Include
|
|
85 HiLink slangPreCondit PreCondit
|
|
86 HiLink slangError Error
|
|
87 HiLink slangStatement Statement
|
|
88 HiLink slangType Type
|
|
89 HiLink slangString String
|
|
90 HiLink slangConstant Constant
|
|
91 HiLink slangRangeArray slangConstant
|
|
92 HiLink slangComment Comment
|
|
93 HiLink slangSpecial SpecialChar
|
|
94 HiLink slangTodo Todo
|
|
95 HiLink slangDelim Delimiter
|
|
96
|
|
97 delcommand HiLink
|
|
98 endif
|
|
99
|
|
100 let b:current_syntax = "slang"
|
|
101
|
|
102 " vim: ts=8
|