blob: 515912ed89814210ddd6b1d7d8a5b9d92e6542a1 [file] [log] [blame]
Christian Brabandt6efb1982023-08-10 05:44:25 +02001! vim: set ft=rapid :
2
3! START_INDENT
4
5%%%
6 VERSION:1
7 LANGUAGE:ENGLISH
8%%%
9
10module LowerCaseModule
11
12task pers num n1 := 0;
13local pers num n2 := 1;
14var bool b1 := false;
15var intnum i1;
16
17! put some stuff in those strings that may confuse indentation
18const string st1 := "endmodule (";
19pers string st_Appl_Info{3,3}:=[
20[
21"["
22,
23"default"
24,
25"case"
26],
27[
28"else"
29,
30"then"
31,
32"endif"
33],
34[
35"do"
36,
37"}"
38,
39")"
40],
41];
42
43pers tooldata tTool1:=[TRUE,
44[
45[97.4, 0, 223.1],
46[0.924, 0, 0.383 ,0]
47],
48[5,
49[23, 0, 75],
50[1, 0, 0, 0], 0, 0, 0
51]
52];
53const robtarget p1:=[
54[600, 500, 225.3],
55[1, 0, 0, 0],
56[1, 1, 0, 0],
57[ 11, 12.3, 9E9, 9E9, 9E9, 9E9]
58];
59
60record myRec
61num nRecNum1
62bool bRecBool1
63endrecord
64
65proc proc1(num n1,
66num n2)
67var string st1;
68n1 := n1+1;
69MoveJSync p1, vmax, z30, tool1, "proc2";
70backward
71MoveJSync p1, v100, fine, tool1, "proc2";
72undo
73n1 := n1-1;
74error
75trynext;
76endproc
77
78func num nFunc1(
79switch s1
80|switch s2
81,num n1
82,bool b1)
83var num nVar;
84if not Present(s1) return;
85if Present(s1) then
86Incr n1;'
87elseif Present(s2) then
88b1:=false;
89else
90while n1>0 do
91Decr n1;
92test n1
93
94case 1:
95test1;
96case 2:
97test2;
98default:
99WaitUntil false;
100endtest
101endwhile
102endif
103for i from 1 to 10 step 2 do
104for j from 1 to 10 do
105st_Appl_Info{i,j} := "";
106endfor
107endfor
108! return 1;
109return 0;
110error
111return -1;
112endfunc
113
114trap Trap1
115Reset do1;
116endtrap
117
118endmodule
119
120MODULE UpperCaseModule(SYSMODULE,NOSTEPIN)
121TASK pers num n1 := 0;
122LOCAL pers num n2 := 1;
123VAR bool b1 := false;
124VAR intnum i1;
125
126LOCAL FUNC num nFunc1(
127switch s1
128|switch s2
129,num n1
130,bool b1)
131VAR num nVar;
132IF NOT PRESENT(s1) RETURN;
133IF PRESENT(s1) THEN
134INCR n1;'
135ELSEIF PRESENT(s2) THEN
136b1:=FALSE;
137ELSE
138WHILE n1>0 DO
139DECR n1;
140TEST n1
141
142CASE 1:
143test1;
144CASE 2:
145test2;
146DEFAULT:
147WAITUNTIL FALSE;
148ENDTEST
149ENDWHILE
150ENDIF
151FOR i FROM 1 TO 10 STEP 2 DO
152FOR j FROM 1 TO 10 DO
153st_Appl_Info{i,j} := "";
154ENDFOR
155ENDFOR
156! RETURN 1;
157RETURN 0;
158ERROR
159RETURN -1;
160ENDFUNC
161
162TRAP Trap1
163Reset do1;
164ENDTRAP
165
166ENDMODULE
167
168Module MixedCaseModule(SysModule)
169Task pers num n1 := 0;
170Local pers num n2 := 1;
171Var bool b1 := false;
172Var intnum i1;
173
174Task Func num nFunc1(
175switch s1
176|switch s2
177,num n1
178,bool b1)
179Var num nVar;
180If Not Present(s1) Return;
181If Present(s1) Then
182Incr n1;'
183ElseIf Present(s2) Then
184b1:=false;
185Else
186While n1>0 Do
187Decr n1;
188Test n1
189
190Case 1:
191test1;
192Case 2:
193test2;
194Default:
195WaitUntil false;
196EndTest
197EndWhile
198EndIf
199For i From 1 To 10 Step 2 Do
200For j From 1 To 10 Do
201st_Appl_Info{i,j} := "";
202EndFor
203EndFor
204! Return 1;
205Return 0;
206Error
207Return -1;
208EndFunc
209
210Trap Trap1
211Reset do1;
212EndTrap
213
214EndModule
215
216! END_INDENT
217
218! START_INDENT
219! INDENT_EXE let g:rapidSpaceIndent = 0
220! INDENT_EXE set shiftwidth=4
221
222proc bla()
223var num i;
224Incr i;
225endproc
226
227! END_INDENT
228
229! START_INDENT
230! INDENT_EXE let g:rapidCommentIndent = 1
231!
232proc bla()
233! indent this first column comment because of g:rapidCommentIndent=1
234endproc
235! END_INDENT
236
237! START_INDENT
238! INDENT_EXE let g:rapidNewStyleIndent = 1
239pers string st_Appl_Info{3,3}:=
240[
241[
242"["
243,
244"default"
245,
246"case"
247]
248,
249[
250"else"
251,
252"then"
253,
254"endif"
255]
256,
257[
258"do"
259,
260"}"
261,
262")"
263]
264,
265];
266! END_INDENT