Commit 9e77379
committed
Merge #354: feat: unstable with traits
b8d2b34 Add unstable features docs (Sdoba16)
822af47 Add unstable features check to compiler (Sdoba16)
105f2ca Add RequireFeature trait for current AST nodes (Sdoba16)
b8b83f7 Add unstable features basic functionality (Sdoba16)
Pull request description:
Closes #317
Replaces #329
Added `UnstableFeature` enum to track available unstable features
Added `UnstableFeatures` to check whether a feature is enabled
Added `RequireFeature` trait, implemented for every AST node. Each node reports which unstable features it requires. Struct impls use full field destructuring and enum impls use exhaustive matches, so new nodes or fields cause a compile error until the impl is updated.
The check runs at parse time: once a program parses without errors, any use of a disabled feature is reported with an error naming the feature and the `-Z` flag that enables it.
Added a `-Z <feature>` flag to the CLI. Multiple features can be passed with repeated flags. Available features are listed in the help output.
`simc program.simf -Z imports`
Added `doc/unstable-features.md` with user and developer guides.
ACKs for top commit:
KyrylR:
ACK b8d2b34; successfully ran local tests
Tree-SHA512: af9b3f392692605bffd4dec1bd40acd47d27d98c483360fe17be531095c2cdf98476f1c05706115a0c732db5f0c7b023681ac0cda4bed87302dac6a16f87b3bf11 files changed
Lines changed: 967 additions & 73 deletions
File tree
- doc
- src
- compile
- driver
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| 232 | + | |
229 | 233 | | |
230 | 234 | | |
231 | 235 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
| 253 | + | |
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
| |||
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
266 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| |||
321 | 330 | | |
322 | 331 | | |
323 | 332 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
327 | 340 | | |
328 | 341 | | |
329 | 342 | | |
| |||
346 | 359 | | |
347 | 360 | | |
348 | 361 | | |
349 | | - | |
| 362 | + | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
| |||
421 | 434 | | |
422 | 435 | | |
423 | 436 | | |
| 437 | + | |
424 | 438 | | |
425 | 439 | | |
426 | 440 | | |
| |||
493 | 507 | | |
494 | 508 | | |
495 | 509 | | |
496 | | - | |
497 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
498 | 515 | | |
499 | 516 | | |
500 | 517 | | |
501 | 518 | | |
502 | 519 | | |
503 | | - | |
504 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
505 | 528 | | |
506 | 529 | | |
507 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
481 | 485 | | |
482 | 486 | | |
483 | 487 | | |
| |||
643 | 647 | | |
644 | 648 | | |
645 | 649 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
654 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
655 | 660 | | |
656 | 661 | | |
657 | 662 | | |
| |||
880 | 885 | | |
881 | 886 | | |
882 | 887 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | 888 | | |
892 | 889 | | |
893 | 890 | | |
| |||
0 commit comments