blob: 1bfc0036787b4130b926071450c66107c1e796db [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001"
2" Vim syntax file
3" Language : Scilab
4" Maintainer : Benoit Hamelin
5" File type : *.sci (see :help filetype)
6" History
7" 28jan2002 benoith 0.1 Creation. Adapted from matlab.vim.
8" 04feb2002 benoith 0.5 Fixed bugs with constant highlighting.
9"
10
11
12" For version 5.x: Clear all syntax items
13" For version 6.x: Quit when a syntax file was already loaded
14if version < 600
15 syntax clear
16elseif exists("b:current_syntax")
17 finish
18endif
19
20
21" Reserved words.
22syn keyword scilabStatement abort clear clearglobal end exit global mode predef quit resume
23syn keyword scilabStatement return
24syn keyword scilabFunction function endfunction funptr
25syn keyword scilabPredicate null iserror isglobal
26syn keyword scilabKeyword typename
27syn keyword scilabDebug debug pause what where whereami whereis who whos
28syn keyword scilabRepeat for while break
29syn keyword scilabConditional if then else elseif
30syn keyword scilabMultiplex select case
31
32" Reserved constants.
33syn match scilabConstant "\(%\)[0-9A-Za-z?!#$]\+"
34syn match scilabBoolean "\(%\)[FTft]\>"
35
36" Delimiters and operators.
37syn match scilabDelimiter "[][;,()]"
38syn match scilabComparison "[=~]="
39syn match scilabComparison "[<>]=\="
40syn match scilabComparison "<>"
41syn match scilabLogical "[&|~]"
42syn match scilabAssignment "="
43syn match scilabArithmetic "[+-]"
44syn match scilabArithmetic "\.\=[*/\\]\.\="
45syn match scilabArithmetic "\.\=^"
46syn match scilabRange ":"
47syn match scilabMlistAccess "\."
48
49syn match scilabLineContinuation "\.\{2,}"
50
51syn match scilabTransposition "[])a-zA-Z0-9?!_#$.]'"lc=1
52
53" Comments and tools.
54syn keyword scilabTodo TODO todo FIXME fixme TBD tbd contained
55syn match scilabComment "//.*$" contains=scilabTodo
56
57" Constants.
58syn match scilabNumber "[0-9]\+\(\.[0-9]*\)\=\([DEde][+-]\=[0-9]\+\)\="
59syn match scilabNumber "\.[0-9]\+\([DEde][+-]\=[0-9]\+\)\="
60syn region scilabString start=+'+ skip=+''+ end=+'+ oneline
61syn region scilabString start=+"+ end=+"+ oneline
62
63" Identifiers.
64syn match scilabIdentifier "\<[A-Za-z?!_#$][A-Za-z0-9?!_#$]*\>"
65syn match scilabOverload "%[A-Za-z0-9?!_#$]\+_[A-Za-z0-9?!_#$]\+"
66
67
68" Define the default highlighting.
69" For version 5.7 and earlier: only when not done already
70" For version 5.8 and later: only when an item doesn't have highlighting yet
71if version >= 508 || !exists("did_scilab_syntax_inits")
72 if version < 508
73 let did_scilab_syntax_inits = 1
74 command -nargs=+ HiLink hi link <args>
75 else
76 command -nargs=+ HiLink hi def link <args>
77 endif
78
79 HiLink scilabStatement Statement
80 HiLink scilabFunction Keyword
81 HiLink scilabPredicate Keyword
82 HiLink scilabKeyword Keyword
83 HiLink scilabDebug Debug
84 HiLink scilabRepeat Repeat
85 HiLink scilabConditional Conditional
86 HiLink scilabMultiplex Conditional
87
88 HiLink scilabConstant Constant
89 HiLink scilabBoolean Boolean
90
91 HiLink scilabDelimiter Delimiter
92 HiLink scilabMlistAccess Delimiter
93 HiLink scilabComparison Operator
94 HiLink scilabLogical Operator
95 HiLink scilabAssignment Operator
96 HiLink scilabArithmetic Operator
97 HiLink scilabRange Operator
98 HiLink scilabLineContinuation Underlined
99 HiLink scilabTransposition Operator
100
101 HiLink scilabTodo Todo
102 HiLink scilabComment Comment
103
104 HiLink scilabNumber Number
105 HiLink scilabString String
106
107 HiLink scilabIdentifier Identifier
108 HiLink scilabOverload Special
109
110 delcommand HiLink
111endif
112
113let b:current_syntax = "scilab"
114
115"EOF vim: ts=4 noet tw=100 sw=4 sts=0