Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/matlab.xml
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 92 | <context name="_normal" attribute="Normal Text" lineEndContext="#stay"> | |||
---|---|---|---|---|---|
93 | 93 | | |||
94 | <!-- Look-ahead for adjoint ' after variable, number literal, closing braces and .' --> | 94 | <!-- Look-ahead for adjoint ' after variable, number literal, closing braces and .' --> | ||
95 | <RegExpr context="_adjoint" attribute="Variable" String="[a-zA-Z]\w*(?=')" /> | 95 | <RegExpr context="_adjoint" attribute="Variable" String="[a-zA-Z]\w*(?=')" /> | ||
96 | <RegExpr context="_adjoint" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')" /> | 96 | <RegExpr context="_adjoint" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')" /> | ||
97 | <RegExpr context="_adjoint" attribute="Delimiter" String="[\)\]}](?=')" /> | 97 | <RegExpr context="_adjoint" attribute="Delimiter" String="[\)\]}](?=')" /> | ||
98 | <RegExpr context="_adjoint" attribute="Operator" String="\.'(?=')" /> | 98 | <RegExpr context="_adjoint" attribute="Operator" String="\.'(?=')" /> | ||
99 | 99 | | |||
100 | <!-- If ' is not the adjoint operator, it starts a string or an unterminated string --> | 100 | <!-- If ' is not the adjoint operator, it starts a string or an unterminated string --> | ||
101 | <RegExpr context="#stay" attribute="String" String="'[^']*(''[^']*)*'(?=[^']|$)" /> | 101 | <RegExpr context="#stay" attribute="CharVector" String="'[^']*(''[^']*)*'(?=[^']|$)" /> | ||
102 | <RegExpr context="#stay" attribute="Incomplete String" String="'[^']*(''[^']*)*" /> | 102 | <RegExpr context="#stay" attribute="Incomplete CharVector" String="'[^']*(''[^']*)*" /> | ||
103 | <RegExpr context="#stay" attribute="String" String=""[^"]*(""[^"]*)*"(?=[^"]|$)" /> | ||||
104 | <RegExpr context="#stay" attribute="Incomplete String" String=""[^"]*(""[^"]*)*" /> | ||||
103 | 105 | | |||
104 | <!-- Handling of keywords, comments, system commands, identifiers, numbers and braces --> | 106 | <!-- Handling of keywords, comments, system commands, identifiers, numbers and braces --> | ||
105 | <keyword context="#stay" attribute="Keyword" String="KeywordsList" /> | 107 | <keyword context="#stay" attribute="Keyword" String="KeywordsList" /> | ||
106 | <RegExpr context="#stay" attribute="Comment" String="%.*$" /> | 108 | <RegExpr context="#stay" attribute="Comment" String="%.*$" /> | ||
107 | <RegExpr context="#stay" attribute="System" String="!.*$" /> | 109 | <RegExpr context="#stay" attribute="System" String="!.*$" /> | ||
108 | <RegExpr context="#stay" attribute="Variable" String="[a-zA-Z]\w*" /> | 110 | <RegExpr context="#stay" attribute="Variable" String="[a-zA-Z]\w*" /> | ||
109 | <RegExpr context="#stay" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?" /> | 111 | <RegExpr context="#stay" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?" /> | ||
110 | <AnyChar context="#stay" attribute="Delimiter" String="()[]{}"/> | 112 | <AnyChar context="#stay" attribute="Delimiter" String="()[]{}"/> | ||
Show All 24 Lines | |||||
135 | </contexts> | 137 | </contexts> | ||
136 | 138 | | |||
137 | <itemDatas> | 139 | <itemDatas> | ||
138 | <itemData name="Normal Text" defStyleNum="dsNormal" /> | 140 | <itemData name="Normal Text" defStyleNum="dsNormal" /> | ||
139 | <itemData name="Variable" defStyleNum="dsNormal" /> | 141 | <itemData name="Variable" defStyleNum="dsNormal" /> | ||
140 | <itemData name="Operator" defStyleNum="dsNormal"/> | 142 | <itemData name="Operator" defStyleNum="dsNormal"/> | ||
141 | <itemData name="Number" defStyleNum="dsFloat" /> | 143 | <itemData name="Number" defStyleNum="dsFloat" /> | ||
142 | <itemData name="Delimiter" defStyleNum="dsNormal" /> | 144 | <itemData name="Delimiter" defStyleNum="dsNormal" /> | ||
145 | <itemData name="CharVector" defStyleNum="dsSpecialString" color="#b20000"/> | ||||
143 | <itemData name="String" defStyleNum="dsString" color="#b20000"/> | 146 | <itemData name="String" defStyleNum="dsString" color="#b20000"/> | ||
144 | <itemData name="System" defStyleNum="dsBaseN" color="#b28c00"/> | 147 | <itemData name="System" defStyleNum="dsBaseN" color="#b28c00"/> | ||
145 | <itemData name="Incomplete String" defStyleNum="dsChar" color="#a020f0"/> | 148 | <itemData name="Incomplete CharVector" defStyleNum="dsError" color="#a020f0"/> | ||
149 | <itemData name="Incomplete String" defStyleNum="dsError" color="#a020f0"/> | ||||
146 | <itemData name="Keyword" defStyleNum="dsNormal" color="#0000ff"/> | 150 | <itemData name="Keyword" defStyleNum="dsNormal" color="#0000ff"/> | ||
147 | <itemData name="Comment" defStyleNum="dsComment" color="#009900"/> | 151 | <itemData name="Comment" defStyleNum="dsComment" color="#009900"/> | ||
148 | </itemDatas> | 152 | </itemDatas> | ||
149 | <!-- MATLAB 6.5 default color scheme | 153 | <!-- MATLAB 6.5 default color scheme | ||
150 | keywords #0000ff | 154 | keywords #0000ff | ||
151 | comments #228b22 | 155 | comments #228b22 | ||
152 | strings #b20000 | 156 | strings #b20000 | ||
153 | unterminated strings #a020f0 | 157 | unterminated strings #a020f0 | ||
Show All 31 Lines | |||||
185 | % unary operators | 189 | % unary operators | ||
186 | a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').' | 190 | a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').' | ||
187 | % separators and delimiter | 191 | % separators and delimiter | ||
188 | (asd),[sadf];{asdf},;;,;;;() | 192 | (asd),[sadf];{asdf},;;,;;;() | ||
189 | % continuation | 193 | % continuation | ||
190 | a = 1+ ... | 194 | a = 1+ ... | ||
191 | 2; | 195 | 2; | ||
192 | 196 | | |||
193 | % Strings and adjoint _________________________________ | 197 | % Character vectors, strings and adjoint ______________ | ||
194 | % incomplete strings | 198 | % incomplete character vectors | ||
195 | 'string | 199 | 'string | ||
196 | 'str'' | 200 | 'str'' | ||
197 | 'str''ing | 201 | 'str''ing | ||
198 | % complete strings | 202 | % complete character vectors | ||
199 | 'string' % simple string | 203 | 'string' % simple string | ||
200 | '''' % string containing ' | 204 | '''' % string containing ' | ||
201 | 'str''ing' % one string containing ' | 205 | 'str''ing' % one string containing ' | ||
202 | 'string' 'string' % two strings | 206 | '"' % string containing " | ||
203 | 'asdf' 'asdf''' variable % two strings and a variable | 207 | 'str"ing' % one string containing " | ||
208 | 'string' 'string' % two character vectors | ||||
209 | 'asdf' 'asdf''' variable % two character vectors and a variable | ||||
204 | 'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';'' | 210 | 'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';'' | ||
205 | 'sadf'.' % string transpose | 211 | 'sadf'.' % string transpose | ||
206 | % adjoint | 212 | % adjoint | ||
207 | {'asdf'}' + 1 | 213 | {'asdf'}' + 1 | ||
208 | ('asdf')' + 1 | 214 | ('asdf')' + 1 | ||
209 | ['asdf']' + 1 | 215 | ['asdf']' + 1 | ||
210 | '' var''' % empty string, var with >1 adjoints | 216 | '' var''' % empty string, var with >1 adjoints | ||
211 | [5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints | 217 | [5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints | ||
212 | A'*B + 1 % adjoint | 218 | A'*B + 1 % adjoint | ||
213 | A.'*B + 1 % transpose | 219 | A.'*B + 1 % transpose | ||
214 | A.'.'*B + 1 % double transpose | 220 | A.'.'*B + 1 % double transpose | ||
215 | A'.' + 1 % adjoint, then transpose | 221 | A'.' + 1 % adjoint, then transpose | ||
216 | A.'' % transpose, then adjoint | 222 | A.'' % transpose, then adjoint | ||
223 | % incomplete strings | ||||
224 | "string | ||||
225 | "str"" | ||||
226 | "str""ing | ||||
227 | % complete strings | ||||
228 | "string" % simple string | ||||
229 | "'" % string containing ' | ||||
230 | "str'ing" % one string containing ' | ||||
231 | """" % string containing " | ||||
232 | "str""ing" % one string containing " | ||||
233 | "string" "string" % two strings | ||||
234 | "asdf" "asdf""" variable % two strings and a variable | ||||
217 | 235 | | |||
218 | % System command ______________________________________ | 236 | % System command ______________________________________ | ||
219 | !hostname | 237 | !hostname | ||
220 | !cp * /tmp | 238 | !cp * /tmp | ||
221 | 239 | | |||
222 | % Reserved keywords ___________________________________ | 240 | % Reserved keywords ___________________________________ | ||
223 | function, persistent, global | 241 | function, persistent, global | ||
224 | switch, case, otherwise | 242 | switch, case, otherwise | ||
225 | if, else, elseif | 243 | if, else, elseif | ||
226 | try, catch | 244 | try, catch | ||
227 | for, while, break, continue | 245 | for, while, break, continue | ||
228 | end, return | 246 | end, return | ||
229 | function, FUNCTION, Function % case sensitive! | 247 | function, FUNCTION, Function % case sensitive! | ||
230 | --> | 248 | --> |