annotate runtime/syntax/matlab.vim @ 7183:ffad29dc7eee

commit https://github.com/vim/vim/commit/a0f849ee40cbea3c889345256786b640b0becca2 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 30 14:37:44 2015 +0100 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Fri, 30 Oct 2015 14:45:04 +0100
parents fd09a9c8468e
children 43efa4f5a8ea
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
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
3 " Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
4 " Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Original author: Mario Eusebio
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
6 " Last Change: Wed Jan 13 11:12:34 CET 2010
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2043
diff changeset
7 " sinh added to matlab implicit commands
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2043
diff changeset
8 " Change History:
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
9 " - 'global' and 'persistent' keyword are now recognized
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn keyword matlabStatement return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword matlabLabel case switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword matlabConditional else elseif end if otherwise
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword matlabRepeat do for while
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
23 " MT_ADDON - added exception-specific keywords
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
24 syn keyword matlabExceptions try catch
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
25 syn keyword matlabOO classdef properties events methods
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword matlabTodo contained TODO
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
28 syn keyword matlabScope global persistent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " 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
31 syn match matlabArithmeticOperator "[-+]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match matlabArithmeticOperator "\.\=[*/\\^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match matlabRelationalOperator "[=~]="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match matlabRelationalOperator "[<>]=\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match matlabLogicalOperator "[&|~]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match matlabLineContinuation "\.\{3}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 "syn match matlabIdentifier "\<\a\w*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " String
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
42 " MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
43 syn region matlabString start=+'+ end=+'+ oneline skip=+''+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " If you don't like tabs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match matlabTab "\t"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Standard numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match matlabNumber "\<\d\+[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " Transpose character and delimiters: Either use just [...] or (...) aswell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match matlabDelimiter "[][]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 "syn match matlabDelimiter "[][()]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match matlabSemicolon ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
62 syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
63 " MT_ADDON - correctly highlights words after '...' as comments
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
64 syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
65 syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword matlabOperator break zeros default margin round ones rand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword matlabFunction error eval function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword matlabImplicit abs acos atan asin cos cosh exp log prod sum
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2043
diff changeset
73 syn keyword matlabImplicit log10 max min sign sin sinh sqrt tan reshape
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match matlabError "-\=\<\d\+\.\d\+\.[^*/\\^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn match matlabError "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " 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
81 if version >= 508 || !exists("did_matlab_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 let did_matlab_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink matlabTransposeOperator matlabOperator
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
90 HiLink matlabOperator Operator
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
91 HiLink matlabLineContinuation Special
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink matlabLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink matlabConditional Conditional
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
94 HiLink matlabExceptions Conditional
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink matlabRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink matlabTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink matlabString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink matlabDelimiter Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink matlabTransposeOther Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink matlabNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink matlabFloat Float
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
102 HiLink matlabFunction Function
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink matlabError Error
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
104 HiLink matlabImplicit matlabStatement
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink matlabStatement Statement
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
106 HiLink matlabOO Statement
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink matlabSemicolon SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink matlabComment Comment
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
109 HiLink matlabMultilineComment Comment
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
110 HiLink matlabScope Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink matlabArithmeticOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 HiLink matlabRelationalOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 HiLink matlabLogicalOperator matlabOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 "optional highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 "HiLink matlabIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 "HiLink matlabTab Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 let b:current_syntax = "matlab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 "EOF vim: ts=8 noet tw=100 sw=8 sts=0