Mercurial > vim
annotate runtime/indent/testdir/rapid.in @ 32721:94f4a488412e v9.0.1683
Updated runtime files
Commit: https://github.com/vim/vim/commit/6efb1980336ff324e9c57a4e282530b952fca816
Author: Christian Brabandt <cb@256bit.org>
Date: Thu Aug 10 05:44:25 2023 +0200
Updated runtime files
This is a collection of various PRs from github that all require a minor
patch number:
1) https://github.com/vim/vim/pull/12612
Do not conflate dictionary key with end of block
2) https://github.com/vim/vim/pull/12729:
When saving and restoring 'undolevels', the constructs `&undolevels` and
`:set undolevels` are problematic.
The construct `&undolevels` reads an unpredictable value; it will be the
local option value (if one has been set), or the global option value
(otherwise), making it unsuitable for saving a value for later
restoration.
Similarly, if a local option value has been set for 'undolevels',
temporarily modifying the option via `:set undolevels` changes the local
value as well as the global value, requiring extra work to restore both
values.
Saving and restoring the option value in one step via the construct
`:let &undolevels = &undolevels` appears to make no changes to the
'undolevels' option, but if a local option has been set to a different
value than the global option, it has the unintended effect of changing
the global 'undolevels' value to the local value.
Update the documentation to explain these issues and recommend explicit
use of global and local option values when saving and restoring. Update
some unit tests to use `g:undolevels`.
3) https://github.com/vim/vim/pull/12702:
Problem: Pip requirements files are not recognized.
Solution: Add a pattern to match pip requirements files.
4) https://github.com/vim/vim/pull/12688:
Add indent file and tests for ABB Rapid
5) https://github.com/vim/vim/pull/12668:
Use Lua 5.1 numeric escapes in tests and add to CI
Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings. Lua
5.1 only supports decimal escapes:
> A character in a string can also be specified by its numerical value
> using the escape sequence \ddd, where ddd is a sequence of up to three
> decimal digits. (Note that if a numerical escape is to be followed by a
> digit, it must be expressed using exactly three digits.) Strings in Lua
> can contain any 8-bit value, including embedded zeros, which can be
> specified as '\0'.
To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to
run with Lua 5.1 as well as Lua 5.4
6) https://github.com/vim/vim/pull/12631:
Add hurl filetype detection
7) https://github.com/vim/vim/pull/12573:
Problem: Files for haskell persistent library are not recognized
Solution: Add pattern persistentmodels for haskell persistent library
closes: #12612
closes: #12729
closes: #12702
closes: #12688
closes: #12668
closes: #12631
closes: #12573
Co-authored-by: lacygoill <lacygoill@lacygoill.me>
Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev>
Co-authored-by: Borys Lykah <lykahb@fastmail.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 10 Aug 2023 06:30:06 +0200 |
parents | |
children |
rev | line source |
---|---|
32721 | 1 ! vim: set ft=rapid : |
2 | |
3 ! START_INDENT | |
4 | |
5 %%% | |
6 VERSION:1 | |
7 LANGUAGE:ENGLISH | |
8 %%% | |
9 | |
10 module LowerCaseModule | |
11 | |
12 task pers num n1 := 0; | |
13 local pers num n2 := 1; | |
14 var bool b1 := false; | |
15 var intnum i1; | |
16 | |
17 ! put some stuff in those strings that may confuse indentation | |
18 const string st1 := "endmodule ("; | |
19 pers 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 | |
43 pers 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 ]; | |
53 const 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 | |
60 record myRec | |
61 num nRecNum1 | |
62 bool bRecBool1 | |
63 endrecord | |
64 | |
65 proc proc1(num n1, | |
66 num n2) | |
67 var string st1; | |
68 n1 := n1+1; | |
69 MoveJSync p1, vmax, z30, tool1, "proc2"; | |
70 backward | |
71 MoveJSync p1, v100, fine, tool1, "proc2"; | |
72 undo | |
73 n1 := n1-1; | |
74 error | |
75 trynext; | |
76 endproc | |
77 | |
78 func num nFunc1( | |
79 switch s1 | |
80 |switch s2 | |
81 ,num n1 | |
82 ,bool b1) | |
83 var num nVar; | |
84 if not Present(s1) return; | |
85 if Present(s1) then | |
86 Incr n1;' | |
87 elseif Present(s2) then | |
88 b1:=false; | |
89 else | |
90 while n1>0 do | |
91 Decr n1; | |
92 test n1 | |
93 | |
94 case 1: | |
95 test1; | |
96 case 2: | |
97 test2; | |
98 default: | |
99 WaitUntil false; | |
100 endtest | |
101 endwhile | |
102 endif | |
103 for i from 1 to 10 step 2 do | |
104 for j from 1 to 10 do | |
105 st_Appl_Info{i,j} := ""; | |
106 endfor | |
107 endfor | |
108 ! return 1; | |
109 return 0; | |
110 error | |
111 return -1; | |
112 endfunc | |
113 | |
114 trap Trap1 | |
115 Reset do1; | |
116 endtrap | |
117 | |
118 endmodule | |
119 | |
120 MODULE UpperCaseModule(SYSMODULE,NOSTEPIN) | |
121 TASK pers num n1 := 0; | |
122 LOCAL pers num n2 := 1; | |
123 VAR bool b1 := false; | |
124 VAR intnum i1; | |
125 | |
126 LOCAL FUNC num nFunc1( | |
127 switch s1 | |
128 |switch s2 | |
129 ,num n1 | |
130 ,bool b1) | |
131 VAR num nVar; | |
132 IF NOT PRESENT(s1) RETURN; | |
133 IF PRESENT(s1) THEN | |
134 INCR n1;' | |
135 ELSEIF PRESENT(s2) THEN | |
136 b1:=FALSE; | |
137 ELSE | |
138 WHILE n1>0 DO | |
139 DECR n1; | |
140 TEST n1 | |
141 | |
142 CASE 1: | |
143 test1; | |
144 CASE 2: | |
145 test2; | |
146 DEFAULT: | |
147 WAITUNTIL FALSE; | |
148 ENDTEST | |
149 ENDWHILE | |
150 ENDIF | |
151 FOR i FROM 1 TO 10 STEP 2 DO | |
152 FOR j FROM 1 TO 10 DO | |
153 st_Appl_Info{i,j} := ""; | |
154 ENDFOR | |
155 ENDFOR | |
156 ! RETURN 1; | |
157 RETURN 0; | |
158 ERROR | |
159 RETURN -1; | |
160 ENDFUNC | |
161 | |
162 TRAP Trap1 | |
163 Reset do1; | |
164 ENDTRAP | |
165 | |
166 ENDMODULE | |
167 | |
168 Module MixedCaseModule(SysModule) | |
169 Task pers num n1 := 0; | |
170 Local pers num n2 := 1; | |
171 Var bool b1 := false; | |
172 Var intnum i1; | |
173 | |
174 Task Func num nFunc1( | |
175 switch s1 | |
176 |switch s2 | |
177 ,num n1 | |
178 ,bool b1) | |
179 Var num nVar; | |
180 If Not Present(s1) Return; | |
181 If Present(s1) Then | |
182 Incr n1;' | |
183 ElseIf Present(s2) Then | |
184 b1:=false; | |
185 Else | |
186 While n1>0 Do | |
187 Decr n1; | |
188 Test n1 | |
189 | |
190 Case 1: | |
191 test1; | |
192 Case 2: | |
193 test2; | |
194 Default: | |
195 WaitUntil false; | |
196 EndTest | |
197 EndWhile | |
198 EndIf | |
199 For i From 1 To 10 Step 2 Do | |
200 For j From 1 To 10 Do | |
201 st_Appl_Info{i,j} := ""; | |
202 EndFor | |
203 EndFor | |
204 ! Return 1; | |
205 Return 0; | |
206 Error | |
207 Return -1; | |
208 EndFunc | |
209 | |
210 Trap Trap1 | |
211 Reset do1; | |
212 EndTrap | |
213 | |
214 EndModule | |
215 | |
216 ! END_INDENT | |
217 | |
218 ! START_INDENT | |
219 ! INDENT_EXE let g:rapidSpaceIndent = 0 | |
220 ! INDENT_EXE set shiftwidth=4 | |
221 | |
222 proc bla() | |
223 var num i; | |
224 Incr i; | |
225 endproc | |
226 | |
227 ! END_INDENT | |
228 | |
229 ! START_INDENT | |
230 ! INDENT_EXE let g:rapidCommentIndent = 1 | |
231 ! | |
232 proc bla() | |
233 ! indent this first column comment because of g:rapidCommentIndent=1 | |
234 endproc | |
235 ! END_INDENT | |
236 | |
237 ! START_INDENT | |
238 ! INDENT_EXE let g:rapidNewStyleIndent = 1 | |
239 pers 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 |