Changeset View
Changeset View
Standalone View
Standalone View
autotests/input/test.m
- This file was added.
1 | %%===================================================== | ||||
---|---|---|---|---|---|
2 | % MATLAB test code for Kate/Kwrite syntax highlighting | ||||
3 | %%===================================================== | ||||
4 | | ||||
5 | % Numbers _____________________________________________ | ||||
6 | 5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i | ||||
7 | 5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i' | ||||
8 | | ||||
9 | % Operators ___________________________________________ | ||||
10 | % relational operators | ||||
11 | 'asdf'~=4, c<=4, d>=4, a<b, a>b, a==b, b||c, b&&c | ||||
12 | % elementwise arithmetic operators | ||||
13 | a.^b, a.*b a./b, 1:4:5 | ||||
14 | % single-character binary arithmetic | ||||
15 | a+3, a-3, a*2, a^3, a/3, a\3, a|b, a&b | ||||
16 | % unary operators | ||||
17 | a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').' | ||||
18 | % separators and delimiter | ||||
19 | (asd),[sadf];{asdf},;;,;;;() | ||||
20 | % continuation | ||||
21 | a = 1+ ... | ||||
22 | 2; | ||||
23 | | ||||
24 | % Character vectors, strings and adjoint ______________ | ||||
25 | % incomplete character vectors | ||||
26 | 'string | ||||
27 | 'str'' | ||||
28 | 'str''ing | ||||
29 | % complete character vectors | ||||
30 | 'string' % simple string | ||||
31 | '''' % string containing ' | ||||
32 | 'str''ing' % one string containing ' | ||||
33 | '"' % string containing " | ||||
34 | 'str"ing' % one string containing " | ||||
35 | 'string' 'string' % two character vectors | ||||
36 | 'asdf' 'asdf''' variable % two character vectors and a variable | ||||
37 | 'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';'' | ||||
38 | 'sadf'.' % string transpose | ||||
39 | % adjoint | ||||
40 | {'asdf'}' + 1 | ||||
41 | ('asdf')' + 1 | ||||
42 | ['asdf']' + 1 | ||||
43 | '' var''' % empty string, var with >1 adjoints | ||||
44 | [5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints | ||||
45 | A'*B + 1 % adjoint | ||||
46 | A.'*B + 1 % transpose | ||||
47 | A.'.'*B + 1 % double transpose | ||||
48 | A'.' + 1 % adjoint, then transpose | ||||
49 | A.'' % transpose, then adjoint | ||||
50 | % incomplete strings | ||||
51 | "string | ||||
52 | "str"" | ||||
53 | "str""ing | ||||
54 | % complete strings | ||||
55 | "string" % simple string | ||||
56 | "'" % string containing ' | ||||
57 | "str'ing" % one string containing ' | ||||
58 | """" % string containing " | ||||
59 | "str""ing" % one string containing " | ||||
60 | "string" "string" % two strings | ||||
61 | "asdf" "asdf""" variable % two strings and a variable | ||||
62 | | ||||
63 | % System command ______________________________________ | ||||
64 | !hostname | ||||
65 | !cp * /tmp | ||||
66 | | ||||
67 | % Reserved keywords ___________________________________ | ||||
68 | function, persistent, global | ||||
69 | switch, case, otherwise | ||||
70 | if, else, elseif | ||||
71 | try, catch | ||||
72 | for, while, break, continue | ||||
73 | end, return | ||||
74 | function, FUNCTION, Function % case sensitive! |