summary refs log tree commit diff stats
path: root/compiler/layouter.nim
Commit message (Collapse)AuthorAgeFilesLines
* fix #12155, improve nimpretty's handling of pragmas (#17353)Miran2021-03-121-1/+2
|
* Use modern enums in compiler (#15775)cooldome2020-11-021-9/+9
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-3/+3
|
* fix #14401, trailing comma confuses nimpretty (#14867)Miran2020-07-011-0/+3
|
* make `from` an operator (#14241)hlaaftana2020-05-081-1/+1
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-2/+2
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* Refactor closeEmitter to make it more modular (#12365)Federico Ceratto2019-10-071-4/+12
|
* Expose some layouter elements, improve readme (#12361)Federico Ceratto2019-10-041-3/+3
| | | Useful for writing linters and static code analysis
* [backport] fix nimpretty removing space before pragmanarimiran2019-09-271-1/+2
|
* nimpretty: fix #11937 (wrong indentation)narimiran2019-08-191-0/+3
|
* cosmetic improvementsnarimiran2019-08-191-8/+5
| | | | | * remove unused imports * make 'openPars' and 'closedPars' more readable
* nimpretty: fixes #11699Araq2019-07-181-7/+16
|
* [refactoring] nimprettyAraq2019-07-181-15/+29
|
* nimpretty: implement a --maxLineLen command line optionAraq2019-07-121-6/+6
|
* nimpretty: fix #11700, no extra newlines (#11714)Miran2019-07-121-15/+24
|
* minor style changesAraq2019-07-111-3/+3
|
* nimpretty: more comment indentation fixesnarimiran2019-07-091-6/+7
|
* nimpretty: more improvementsAraq2019-07-091-15/+22
|
* nimpretty: yet another improvementAraq2019-07-091-1/+1
|
* nimpretty: don't introduce extra spaces after a colon or a comma (#11672)Miran2019-07-071-3/+7
|
* nimpretty: improved detection of commas and semicolons (#11661)Miran2019-07-061-4/+11
| | | | | | * nimpretty: improved detection of commas and semicolons * address the comments
* nimpretty: don't touch formatted multiline comments (#11663)Miran2019-07-051-19/+27
|
* nimpretty: nicer debugging [ci skip]narimiran2019-07-051-1/+1
|
* nimpretty: relax line length rules when dealing with (inline) comments (#11657)Miran2019-07-051-5/+7
|
* nimpretty: fix out of bounds error [ci skip]narimiran2019-07-041-2/+3
|
* nimpretty: nimpretty now understands splitting newlinesAraq2019-07-041-4/+21
|
* nimpretty: distinguish between the different kinds of newlines in NimAraq2019-07-041-10/+16
|
* [bugfix] fix wrong nimpretty unidents, refs #11616 (#11645)Miran2019-07-031-1/+1
|
* [bugfix] nimpretty indents multiline comments correctly (#11607)Miran2019-07-021-0/+4
|
* nimpretty: bugfix [bugfix]Araq2019-06-281-7/+23
|
* [bugfix] fix #11469, new rules for a newline in nimpretty (#11512)Miran2019-06-261-52/+69
| | | | | * [bugfix] fix #11469, new rules for a newline in nimpretty * concatenate two lines if they have the same indentation level
* [bugfix] nimpretty: better alignment; fixes #11467Araq2019-06-141-6/+12
|
* [bugfix] nimpretty: fixes #11470Araq2019-06-131-3/+3
|
* nimpretty: smart tabs support, fixes #9399 [bugfix]Andreas Rumpf2019-06-101-24/+90
|
* nimpretty: keep a seq of tokens instead of a single string to enable better ↵Andreas Rumpf2019-06-091-72/+90
| | | | transformations [refactoring]
* nimpretty: fixes #10156 [bugfix]Andreas Rumpf2019-06-081-1/+30
|
* nimpretty: fixes #9505 [bugfix]Araq2019-06-071-1/+9
|
* nimpretty: fixes #10177 [bugfix]Araq2019-06-071-40/+67
|
* nimpretty: fixes #10295Araq2019-06-071-5/+9
|
* fixes #10200 (#10950)tofu2019-04-041-1/+2
| | | | | | | | | | | | * fixes #10200 * add rule for other comparison operators * add rule for '!=' * add test * fixed to pass the test
* Initial version of the hot-code reloading support for native targets (#10729)zah2019-02-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * squashed work by Zahary * squashing a ton of useful history... otherwise rebasing on top of upstream Nim after commit 82c009a2cbc5d07ab9a847f1c58228a20efaf219 would be impossible. * Code review changes; Working test suite (without code reloading enabled) * - documentation - implemented the HCR test - almost works... - fix the issue on Unix where for executable targets the source file for the main module of a project in nimcache was being overwritten with the binary itself (and thus the actual source code was lost) - fixing embedded paths to shared objects on unix (the "lib" prefix was being prepended to the entire path instead of just the filename) - other fixes - removing unnecessary includes since that file is already included in chcks.nim which is in turn included in system.nim (and previously was getting imported in chcks.nim but then system.nim improts something... and that breaks HCR (perhaps it could be fixed but it would be nice not to import anything in system)) * fix for clang & C++ - explicitly casting a function pointer to void* more stable mangling of parameter names when HCR is on the length of the static arrays in the DatInit functions is now part of the name of the variables, so when they get resized they get also recreated more stable mangling for inline functions - no longer depends on the module which first used them work on the new complicated HCR test - turned surprisingly complex - WIP test now successfully passes even when re-running `koch test` (previously when the nimcache wasn't cold that lead to errors) better documentation calling setStackBottomWith for PreMain passes over the HcrInit/DatInit/Init calls of all modules are now in the proper order (first all of one type, then all of the next). Also typeinfo globals are registered (created) in a single pass before the DatInit pass (because of the way generic instantiations are handled) Fix the test suite execution on macOs fix for being able to query the program arguments when using HCR on posix! other fixes * Bugfix: Fix a compilation error in C++ mode when a function pointer is converted to a raw pointer * basic documentation for the new hot code reloading semantics * Add change log entry * Don't re-execute the top-level statements while reloading JS code * fix a number of tests broken in a recent bugfix * Review changes * Added {.executeOnReload.} pragma that indicates top-level statements that should be executed on each reload. To make this work, I've modified the way the `if (hcr_init_) {...}` guards are produced in the init code. This still needs more work as the new guards seem to be inserted within the previously generated guards. This change also removes the need for `lastRegistedGlobal` in nimhcr. * Implemented the `signatureHash` magic and the `hasModuleChanged` API depending on it (the actual logic is not imlemented yet). * Add the "hcr" prefix to all HCR-related symbols in the system module. Added a new `hotcodereloading` module exporting the high-level API to the user. Besides being more hygienic, this was also required in order to make it possible to use macros in the high-level API. Without the split, `system` would have to import `macros`, which was going to produce the well-known init problems. * Attempted to solve the "GC markers problem". Crashes were expected with the previous code, because the GC markers were compiled as normal procs are registered in the GC. When their module is unloaded, dangling pointers will remain in the GC tables. To solve this issue, I don't register any GC markers when HCR is on, but I add them to the HCR globals metadata and I use a single marker registed in nimhcr during the initialization of the system module that will be responsible for marking all globals. * fix a compilation error * - implemented the hasModuleChanged functionality - tuples can be returned and broken into different vars in global scope - added comments for the closnig scopes of the if statements in the init proc - the new executeOnReload pragma works now! - other fixes * finally! fixing this hack in a proper way - declaring the destructor out of line (out of the class body) - we no longer need to forward-declare popCurrentExceptionEx * Force full module parsing This is a temporary hack that breaks some tests. I'll investigate later how these can be fixed. * tuples are now properly handled when global! * these comments mess up the codegen in debug mode when $n is not actually a new line (or something like that) - these labels are intended only for GOTO labels anyway... * "solved" the issue with the .pdb locks on windows when a binary is being debugged and hot code reloading is used at the same time * fixes after rebasing... * small fixes for the test * better handling of globals! no more compiler crashes for locals with the global pragma, also simplified code around loops in global scope which have local vars (actually globals) * we can now use the global pragma even for ... globals! * the right output * lets try those boehm GC tests * after the test is ran it will be at its starting state - no git modifications * clarification in the docs * removed unnecessary line directives for forward declarations of functions - they were causing trouble with hot code reloading when no semantic change propagates to the main module but a line directive got changed and thus the main module had to be recompiled since the .c code had changed * fixed bug! was inserting duplicate keys into the table and later was removing only 1 copy of all the duplicates (after a few reloads) * no longer breaking into DatInit code when not supposed to * fixes after rebasing * yet more fixes after rebasing * Update jssys.nim * Rework the HCR path-handling logic After reviewing the code more carefully, I've noticed that the old logic will be broken when the user overrides the '--out:f' compiler option. Besides fixing this issues, I took the opportunity to implement the missing '--outdir:d' option. Other changes: * ./koch test won't overwrite any HCR and RTL builds located in nim/lib * HCR and RTL are compiled with --threads:on by default * Clean up the globals registration logic * Handle non-flattened top-level stmtlists in JS as well * The HCR is not supported with the Boehm GC yet Also fixes some typos and the expected output of the HCR integration test * The GC marker procs are now properly used as trampolines * Fix the HCR integration test in release builds * Fix ./koch tools * this forward declaration doesn't seem to be necessary, and in fact breaks HCR because a 2nd function pointer is emitted for this externed/rtl func * the forward declaration I removed in the last commit was actually necessary * Attempt to make all tests green * Fix tgenscript * BAT file for running the HCR integration test on Windows [skip ci] * Fix the docgen tests * A final fix for Travis (hopefully)
* nimpretty: explicit --indent option; fixes #9502; refs #9510 [backport]Andreas Rumpf2018-11-111-4/+5
|
* nimpretty: fixes #9673 [backport]Andreas Rumpf2018-11-111-1/+1
|
* nimpretty: fixes #9506Andreas Rumpf2018-10-261-3/+4
|
* nimpretty: fixes #9504Araq2018-10-251-3/+10
|
* nimpretty: fixes #9499Andreas Rumpf2018-10-251-0/+4
|
* nimpretty: fixes #9144Andreas Rumpf2018-10-161-0/+1
|
* nimpretty: add #!nimpretty on/off directivesAndreas Rumpf2018-10-161-2/+18
|
* nimpretty: fixes #8626Andreas Rumpf2018-10-161-2/+2
|
* make tests green againAraq2018-09-071-3/+4
|
.de> 2017-04-26 11:14:53 +0200 committer Andreas Rumpf <rumpf_a@web.de> 2017-04-26 11:14:53 +0200 koch: build release version of nimble' href='/ahoang/Nim/commit/koch.nim?h=devel&id=4cce5883c063ad79564b5e1734f1a62060063ab3'>4cce5883c ^
9605a0f87 ^

d8430f5a7 ^
d8430f5a7 ^
475579541 ^


d8430f5a7 ^
d862d2272 ^


01afff495 ^
41f32f5fb ^
9d2dfa9a9 ^

d862d2272 ^
7d1a96151 ^
c089cf458 ^
5b5bd3811 ^
7d1a96151 ^
5b5bd3811 ^

e6ff6dd9c ^
ca4c64dd7 ^
a5b19ba86 ^
c089cf458 ^
01afff495 ^
41f32f5fb ^

06b986dbd ^
8a5373291 ^
13b72ed0c ^
ba2aa474a ^
d8430f5a7 ^

41f32f5fb ^

ba2aa474a ^


13b72ed0c ^
41f32f5fb ^
765366c1f ^

b42b467b7 ^
73b76b916 ^

475579541 ^
73b76b916 ^

23c77ffa3 ^
d862d2272 ^
02ff5f596 ^
29c075299 ^
02ff5f596 ^
ef6029d3a ^
41f32f5fb ^
dc8d8ebb7 ^
d8430f5a7 ^

01afff495 ^
5f8ab1653 ^
8ed3e295a ^
a4f8a89c8 ^
3b00d9cc7 ^
3905cfeac ^

13b72ed0c ^
813a4f1d8 ^
90119066a ^
6655537c6 ^
41f32f5fb ^

6655537c6 ^
08d82e4b1 ^



90119066a ^
41f32f5fb ^


90119066a ^
3ee048eaa ^
41f32f5fb ^

3ee048eaa ^
76c3b314d ^
c2da0e9b3 ^
6a78f17da ^
76c3b314d ^
90119066a ^

3b00d9cc7 ^
90119066a ^
0f4567d59 ^

0f4567d59 ^






90119066a ^
2169fd63b ^
3b00d9cc7 ^
0f4567d59 ^
cd292568d ^

3b00d9cc7 ^
0f4567d59 ^


90119066a ^

3b00d9cc7 ^
0f4567d59 ^
3b00d9cc7 ^
90119066a ^
0f4567d59 ^

f3756d2cc ^

29f97f8cb ^

3b00d9cc7 ^
0f4567d59 ^
5b789f2da ^

71a1bbffd ^

5b789f2da ^





142e849b9 ^
90119066a ^





76235348f ^
ae6dac6b6 ^
90119066a ^

0f4567d59 ^
90119066a ^

3b00d9cc7 ^
90119066a ^


d6074a7c7 ^
90119066a ^





3b00d9cc7 ^
90119066a ^

346443d1b ^
73c355176 ^
346443d1b ^
90119066a ^
3b00d9cc7 ^

90119066a ^


3b00d9cc7 ^
90119066a ^


6ff8752be ^
3b00d9cc7 ^
4d5c3ebd4 ^
9c3751a37 ^
6ff8752be ^
8b93e4132 ^

2d3385c22 ^




ecdc478da ^

2d3385c22 ^


ecdc478da ^
2d3385c22 ^



a5b19ba86 ^


ecdc478da ^
2d3385c22 ^

a5b19ba86 ^


2d3385c22 ^




ecdc478da ^

2d3385c22 ^





8b93e4132 ^
740527813 ^

d6074a7c7 ^
37229df7f ^
6ff8752be ^
0b4d5e45b ^

90345526b ^
aa8b470cf ^
071ccf3d0 ^
41f32f5fb ^
d29aa4c5a ^
411e602d1 ^
6457e8f56 ^

411e602d1 ^

90119066a ^
b4e25a637 ^
885f250f1 ^













0f4567d59 ^

1a88e2a18 ^

885f250f1 ^
49c6dbf4a ^
c6471b8f7 ^
b4e25a637 ^
885f250f1 ^
b4e25a637 ^
82effc581 ^




c6471b8f7 ^
82effc581 ^




73b76b916 ^






















15a8996d5 ^
7ba565258 ^

















15a8996d5 ^
7ba565258 ^
15a8996d5 ^
3b00d9cc7 ^

99b36cb71 ^
90119066a ^
a5b19ba86 ^




































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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576