annotate runtime/syntax/matlab.vim @ 29709:07c98ba3a36e

Added tag v9.0.0194 for changeset d97b2ce2625879172cb63889780c7387274d4b51
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Aug 2022 14:15:06 +0200
parents 235cbf491430
children
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
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
3 " Maintainer: Alex Burka <vim@alexburka.com>
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
4 " Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
5 " Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Original author: Mario Eusebio
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
7 " Last Change: June 10 2019
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
8 " added highlight rule for double-quoted string literals
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2043
diff changeset
9 " Change History:
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
10 " - double-quoted string literals added
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
11 " - now highlights cell-mode separator comments
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
12 " - 'global' and 'persistent' keyword are now recognized
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2908
diff changeset
14 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2908
diff changeset
15 if exists("b:current_syntax")
7
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=+''+
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
44 syn region matlabStringArray start=+"+ end=+"+ oneline skip=+""+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " If you don't like tabs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match matlabTab "\t"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " Standard numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match matlabNumber "\<\d\+[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Transpose character and delimiters: Either use just [...] or (...) aswell
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 matlabDelimiter "[][()]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match matlabSemicolon ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
63 syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
64 " MT_ADDON - correctly highlights words after '...' as comments
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
65 syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
66 syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
67 syn match matlabCellComment "^%%.*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn keyword matlabOperator break zeros default margin round ones rand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword matlabFunction error eval function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 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
75 syn keyword matlabImplicit log10 max min sign sin sinh sqrt tan reshape
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match matlabError "-\=\<\d\+\.\d\+\.[^*/\\^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn match matlabError "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2908
diff changeset
81 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
83 hi def link matlabTransposeOperator matlabOperator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
84 hi def link matlabOperator Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
85 hi def link matlabLineContinuation Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
86 hi def link matlabLabel Label
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
87 hi def link matlabConditional Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
88 hi def link matlabExceptions Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
89 hi def link matlabRepeat Repeat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
90 hi def link matlabTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
91 hi def link matlabString String
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
92 hi def link matlabStringArray String
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
93 hi def link matlabDelimiter Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
94 hi def link matlabTransposeOther Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
95 hi def link matlabNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
96 hi def link matlabFloat Float
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
97 hi def link matlabFunction Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
98 hi def link matlabError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
99 hi def link matlabImplicit matlabStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
100 hi def link matlabStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
101 hi def link matlabOO Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
102 hi def link matlabSemicolon SpecialChar
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
103 hi def link matlabComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
104 hi def link matlabMultilineComment Comment
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
105 hi def link matlabCellComment Todo
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
106 hi def link matlabScope Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
108 hi def link matlabArithmeticOperator matlabOperator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
109 hi def link matlabRelationalOperator matlabOperator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
110 hi def link matlabLogicalOperator matlabOperator
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 "optional highlighting
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
113 "hi def link matlabIdentifier Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
114 "hi def link matlabTab Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 let b:current_syntax = "matlab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 "EOF vim: ts=8 noet tw=100 sw=8 sts=0