Mercurial > vim
annotate runtime/syntax/matlab.vim @ 10216:c41e1736ad47 v8.0.0008
commit https://github.com/vim/vim/commit/9e02cfa226b2577ec867b544a1a450a428a19880
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 22 21:27:11 2016 +0200
patch 8.0.0008
Problem: Popup complete test is disabled.
Solution: Enable the test and change the assert. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 22 Sep 2016 21:30:04 +0200 |
parents | 46763b01cd9a |
children | 523cd59d6db0 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Matlab | |
2043 | 3 " Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com |
2034 | 4 " Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org> |
7 | 5 " Original author: Mario Eusebio |
2043 | 6 " Last Change: Wed Jan 13 11:12:34 CET 2010 |
2908 | 7 " sinh added to matlab implicit commands |
8 " Change History: | |
2043 | 9 " - 'global' and 'persistent' keyword are now recognized |
7 | 10 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2908
diff
changeset
|
11 " 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
|
12 if exists("b:current_syntax") |
7 | 13 finish |
14 endif | |
15 | |
16 syn keyword matlabStatement return | |
17 syn keyword matlabLabel case switch | |
18 syn keyword matlabConditional else elseif end if otherwise | |
19 syn keyword matlabRepeat do for while | |
2034 | 20 " MT_ADDON - added exception-specific keywords |
21 syn keyword matlabExceptions try catch | |
22 syn keyword matlabOO classdef properties events methods | |
7 | 23 |
24 syn keyword matlabTodo contained TODO | |
2043 | 25 syn keyword matlabScope global persistent |
7 | 26 |
27 " If you do not want these operators lit, uncommment them and the "hi link" below | |
28 syn match matlabArithmeticOperator "[-+]" | |
29 syn match matlabArithmeticOperator "\.\=[*/\\^]" | |
30 syn match matlabRelationalOperator "[=~]=" | |
31 syn match matlabRelationalOperator "[<>]=\=" | |
32 syn match matlabLogicalOperator "[&|~]" | |
33 | |
34 syn match matlabLineContinuation "\.\{3}" | |
35 | |
36 "syn match matlabIdentifier "\<\a\w*\>" | |
37 | |
38 " String | |
2034 | 39 " MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence |
2043 | 40 syn region matlabString start=+'+ end=+'+ oneline skip=+''+ |
7 | 41 |
42 " If you don't like tabs | |
43 syn match matlabTab "\t" | |
44 | |
45 " Standard numbers | |
46 syn match matlabNumber "\<\d\+[ij]\=\>" | |
47 " floating point number, with dot, optional exponent | |
48 syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>" | |
49 " floating point number, starting with a dot, optional exponent | |
50 syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>" | |
51 | |
52 " Transpose character and delimiters: Either use just [...] or (...) aswell | |
53 syn match matlabDelimiter "[][]" | |
54 "syn match matlabDelimiter "[][()]" | |
55 syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1 | |
56 | |
57 syn match matlabSemicolon ";" | |
58 | |
2043 | 59 syn match matlabComment "%.*$" contains=matlabTodo,matlabTab |
2034 | 60 " MT_ADDON - correctly highlights words after '...' as comments |
2043 | 61 syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab |
62 syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab | |
7 | 63 |
64 syn keyword matlabOperator break zeros default margin round ones rand | |
65 syn keyword matlabOperator ceil floor size clear zeros eye mean std cov | |
66 | |
67 syn keyword matlabFunction error eval function | |
68 | |
69 syn keyword matlabImplicit abs acos atan asin cos cosh exp log prod sum | |
2908 | 70 syn keyword matlabImplicit log10 max min sign sin sinh sqrt tan reshape |
7 | 71 |
72 syn match matlabError "-\=\<\d\+\.\d\+\.[^*/\\^]" | |
73 syn match matlabError "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)" | |
74 | |
75 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2908
diff
changeset
|
76 " Only when an item doesn't have highlighting yet |
7 | 77 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
78 hi def link matlabTransposeOperator matlabOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
79 hi def link matlabOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
80 hi def link matlabLineContinuation Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
81 hi def link matlabLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
82 hi def link matlabConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
83 hi def link matlabExceptions Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
84 hi def link matlabRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
85 hi def link matlabTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
86 hi def link matlabString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
87 hi def link matlabDelimiter Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link matlabTransposeOther Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link matlabNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link matlabFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link matlabFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link matlabError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link matlabImplicit matlabStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link matlabStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link matlabOO Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link matlabSemicolon SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link matlabComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link matlabMultilineComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link matlabScope Type |
7 | 100 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link matlabArithmeticOperator matlabOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 hi def link matlabRelationalOperator matlabOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link matlabLogicalOperator matlabOperator |
7 | 104 |
105 "optional highlighting | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 "hi def link matlabIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 "hi def link matlabTab Error |
7 | 108 |
109 | |
110 let b:current_syntax = "matlab" | |
111 | |
112 "EOF vim: ts=8 noet tw=100 sw=8 sts=0 |