annotate runtime/syntax/matlab.vim @ 910:abff2f6a3ad7 v7.0.036

updated for version 7.0-036
author vimboss
date Tue, 11 Jul 2006 20:36:45 +0000
parents 3fc0f57ecb91
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Matlab
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Original author: Mario Eusebio
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 30 May 2003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syn keyword matlabStatement return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn keyword matlabLabel case switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn keyword matlabConditional else elseif end if otherwise
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn keyword matlabRepeat do for while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword matlabTodo contained TODO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " If you do not want these operators lit, uncommment them and the "hi link" below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match matlabArithmeticOperator "[-+]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match matlabArithmeticOperator "\.\=[*/\\^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match matlabRelationalOperator "[=~]="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match matlabRelationalOperator "[<>]=\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match matlabLogicalOperator "[&|~]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match matlabLineContinuation "\.\{3}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 "syn match matlabIdentifier "\<\a\w*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn region matlabString start=+'+ end=+'+ oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " If you don't like tabs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match matlabTab "\t"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Standard numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match matlabNumber "\<\d\+[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Transpose character and delimiters: Either use just [...] or (...) aswell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match matlabDelimiter "[][]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 "syn match matlabDelimiter "[][()]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match matlabSemicolon ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword matlabOperator break zeros default margin round ones rand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword matlabFunction error eval function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword matlabImplicit abs acos atan asin cos cosh exp log prod sum
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword matlabImplicit log10 max min sign sin sqrt tan reshape
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match matlabError "-\=\<\d\+\.\d\+\.[^*/\\^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match matlabError "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 if version >= 508 || !exists("did_matlab_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let did_matlab_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink matlabTransposeOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink matlabOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink matlabLineContinuation Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 HiLink matlabLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 HiLink matlabConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 HiLink matlabRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 HiLink matlabTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 HiLink matlabString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 HiLink matlabDelimiter Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink matlabTransposeOther Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink matlabNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink matlabFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink matlabFunction Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink matlabError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink matlabImplicit matlabStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink matlabStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink matlabSemicolon SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink matlabComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink matlabArithmeticOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink matlabRelationalOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink matlabLogicalOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 "optional highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 "HiLink matlabIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 "HiLink matlabTab Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 let b:current_syntax = "matlab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 "EOF vim: ts=8 noet tw=100 sw=8 sts=0