blob: 34dc0f57b11a8b26e8b7698daa3a79e786b0d212 [file] [log] [blame]
Bram Moolenaar75ab5902022-04-18 15:36:40 +01001; vim: set ft=krl :
2
3; START_INDENT
4
5def One()
6 int i
7 If i==1 then
8 While i>=1
9 For i=1 to 5 step 2
10 Loop
11 i = i+1
12 EndLoop
13 EndFor
14 EndWhile
15 Else
16 Repeat
17 Switch i
18 Case 1
19 Skip 123
20 i = i+1
21 EndSkip 123
22 Spline with $acc=100, $vel.cp=3
23 slin {x 100}
24 scirc {x 110, y 110}, {x 120, y 90}
25 slin {x 200} c_dis
26 Time_Block Start
27 slin {x 300} c_dis
28 Time_Block Part = 22.2
29 slin {y 400} c_dis
30 Time_Block Part = 33.3
31 Time_Block End = 10
32 slin {y 200} c_dis
33 Const_Vel Start +100 OnStart
34 slin {y 300} c_dis
35 slin {x 100}
36 Const_Vel End -5.5
37 slin {y 200} c_dis
38 EndSpline
39 Case 2,3
40 PTP_Spline with $acc=100, $vel.ptp=100
41 sptp {a1 0} c_ptp
42 sptp {a1 90}
43 EndSpline c_spl
44 Default
45 i = i+1
46 EndSwitch
47 Continue
48 Until False
49 EndIf
50end
51
52DEF Two()
53 int i
54END
55
56global def Three()
57 int i
58end
59
60GLOBAL DEF Four()
61 int i
62END
63
64Global Def Five()
65 int i
66End
67
68deffct bool fOne()
69 int i
70endfct
71
72DEFFCT bool fTwo()
73 int i
74ENDFCT
75
76global deffct bool fThree()
77 int i
78endfct
79
80GLOBAL DEFFCT bool fFour()
81 int i
82ENDFCT
83
84Global DefFct bool fFive()
85 int i
86EndFct
87
88DefDat datfile()
89 global int i=1
90; don't indent column 1 comments unless g:krlCommentIndent is set
91; global int o=2
92EndDat
93
94; END_INDENT
95
96; START_INDENT
97; INDENT_EXE let g:krlSpaceIndent = 0
98; INDENT_EXE set shiftwidth=4
99
100def bla()
101 int i
102end
103
104; END_INDENT
105
106; START_INDENT
107; INDENT_EXE let g:krlCommentIndent = 1
108def bla()
109 ; indent this first column comment because of g:krlCommentIndent=1
110end
111; END_INDENT
112
113; START_INDENT
114; INDENT_EXE let g:krlIndentBetweenDef = 0
115def bla()
116int i ; don't indent this line because of g:krlIndentBetweenDef=0
117end
118; END_INDENT
119
120; START_INDENT
121; INDENT_AT this-line
122def Some()
123int f
124if true then
125 f = 1 ; this-line
126endif
127end
128; END_INDENT
129
130; START_INDENT
131; INDENT_NEXT next-line
132def Some()
133 int i
134 ; next-line
135 i = 1 ; should get indent of line 'int i' above
136end
137; END_INDENT
138
139; START_INDENT
140; INDENT_PREV prev-line
141def Some()
142int f
143if true then
144 f = 1
145; prev-line
146endif
147end
148; END_INDENT