-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreduce-mode.tst
130 lines (88 loc) · 3.32 KB
/
reduce-mode.tst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
COMMENT: This file tests reduce-mode syntactic highlighting and
delimiter matching. It begins with a multi-line comment statement
followed by some examples provided by Andrey Grozin.$
x(1):=1$
x(1) :=1$
x(1):= 1$
x(1) := 1$
% for, all, such, that, let, clear, match should be purple; f should be blue:
for all x,y let f(x,y)=0;
for all x,y clear f(x,y);
for all x,y such that x<0 let f(x,y)=0;
for all x,y such that x<0 clear f(x,y);
for all n1,n2 match x1^n1*x2^n2=f(n1,n2);
a where {f(~x)=>0,y=>0} when x>0; % where, when should be purple; f should blue
Comment End of Grozin Examples$
% for, do, write, step, until should be purple; e, pi, i should be dark cyan:
for i := 0 : 10 do write i;
for j := 0 step 2 until 10 do write j;
e^(pi*i) = -1;
-2 = 2e^(pi*i);
{Catalan, Euler_Gamma, Golden_Ratio, Khinchin};
symbolic prin2t(t neq nil);
factor x,cos,sin(x);
remfac x,cos,sin(x);
% array, matrix, vector, operator should be green; a, b, c, x, y, x, p1, p2 should be blue:
array a(10),b(2,3,4);
a(10),b(2,3,4);
array a 10, c 57;
a 10, c 57;
matrix x(2,1),y(3,4),z;
matrix m; operator x; m := mat(x(1,1),x(1,2));
vector p1,p2;
% even, odd etc. should be green; arguments should be blue:
even f1; odd f2;
linear f,g; noncom u,v;
symmetric u,v; antisymmetric l,m;
operator h,g1,arctan;
infix mm; precedence mm,-;
z**2+fac(4)-2*fac 2*y;
2*det xx - 3*w;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Comment Delimiter Highlighting, etc.$
( () { { } } ); ( ();
<< << >> >>; << << >>;
begin begin end end; begin begin end; beginning begin noend end;
% *** INDENTATION PROBLEMS IN FOLLOWING BLOCK: ***
/* before block */
begin /* in block */ scalar var; % in block
comment What an ugly block!$
var /* in block */ := /* in block */ x^2; % in block
comment That was a pointless assignment.;
return /* in block */ var % in block
end /* after block */ ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/* This is a C-style comment! */
Comment The above line no longer breaks this comment!$
procedure foo; bar;
algebraic procedure /* comment here OK */ foo1; bar;
integer
procedure
foo2 /* comment here OK */ x; /* comment here OK */ bar;
% Implied products of variables with strange but legal names:
{10light!-years, 2d!*!*n, 3.3good! morning, 4.4!$sign, 5.5!5goldrings};
1 !Strange1 + 2 var!"iable2 + 3.0 !!names3 + 4.0 ! spaced! 4;
"This is a string!";
"It contains keywords: comment, procedure, operator, lisp, algebraic.";
symbolic
inline
procedure % comment here OK
foo3 % and here!
(x,y); bar;
% Check indentation and filling:
/* The immediately preceding line, without a semicolon, is the
computed output generated by the line with a semicolon which
precedes it. Note that exact indefinite-precision rational
arithmetic was used, in contrast to the limited-precision
arithmetic of traditional programming languages. */
/* We can use the name R2D2 to represent its value in subsequent */
/* expressions such as; */
write "This is a very long multi-line string padded out with garbage to make
it longer and longer...!";
% String continuations should indent to column zero!
Comment This is here to check that the indentation is correct after a
multi-line comment statement (which it appears to be!);
x := a + b;
%%% Recommended end-of-file marker...
;end;
%%% End of file