Commit 62a45c6
committed
Move most
From the docs:
```
The following statements raise the current world age:
1. An explicit invocation of Core.@latestworld
2. The start of every top-level statement
3. The start of every REPL prompt
4. Any type or struct definition
5. Any method definition
6. Any constant declaration
7. Any global variable declaration (but not a global variable assignment)
8. Any using, import, export or public statement
9. Certain other macros like eval (depends on the macro implementation)
```
This commit handles each case as follows:
```
1. = 9
2. I'm not sure this actually happens (or needs to happen, unless we're
being defensive? Doing it after each world-changing operation should
suffice). But if we need it, this would just be emitting once at the
beginning of every lowered output.
3. = 2
4. = 6
5. Emit seeing `method` in linearize
6. Emit seeing `constdecl` in linearize
7. Emit seeing `global` or `globaldecl` in linearize
8. We just defer to `eval`, but should probably go in desugaring later
- using/import recently became builtin calls, and I haven't
updated JL to use them yet. Base._import_using has an expr-based
API that may change, and our importpath destructuring is worth keeping.
- export and public (special forms) are handled in toplevel.c
9. Done for us
```
Other quirks:
- `JuliaLowering.eval_closure_type` calls eval to assign a const, so we still
need to deal with that in closure conversion.
- The `include` hack isn't mentioned in the docs, but can stay in desugaring.
I'm not certain why we don't do the same for non-macro `eval`.latestworlds to linearization1 parent 5edb92a commit 62a45c6
File tree
9 files changed
+526
-552
lines changed- src
- test
9 files changed
+526
-552
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1174 | 1174 | | |
1175 | 1175 | | |
1176 | 1176 | | |
1177 | | - | |
1178 | 1177 | | |
1179 | 1178 | | |
1180 | 1179 | | |
| |||
1229 | 1228 | | |
1230 | 1229 | | |
1231 | 1230 | | |
1232 | | - | |
1233 | 1231 | | |
1234 | 1232 | | |
1235 | 1233 | | |
| |||
2293 | 2291 | | |
2294 | 2292 | | |
2295 | 2293 | | |
2296 | | - | |
2297 | 2294 | | |
2298 | 2295 | | |
2299 | 2296 | | |
| |||
2422 | 2419 | | |
2423 | 2420 | | |
2424 | 2421 | | |
2425 | | - | |
2426 | 2422 | | |
2427 | 2423 | | |
2428 | 2424 | | |
2429 | 2425 | | |
2430 | | - | |
2431 | 2426 | | |
2432 | 2427 | | |
2433 | 2428 | | |
| |||
2761 | 2756 | | |
2762 | 2757 | | |
2763 | 2758 | | |
2764 | | - | |
2765 | 2759 | | |
2766 | 2760 | | |
2767 | 2761 | | |
| |||
2831 | 2825 | | |
2832 | 2826 | | |
2833 | 2827 | | |
2834 | | - | |
2835 | 2828 | | |
2836 | 2829 | | |
2837 | 2830 | | |
| |||
3068 | 3061 | | |
3069 | 3062 | | |
3070 | 3063 | | |
3071 | | - | |
3072 | 3064 | | |
3073 | 3065 | | |
3074 | 3066 | | |
| |||
3386 | 3378 | | |
3387 | 3379 | | |
3388 | 3380 | | |
3389 | | - | |
3390 | 3381 | | |
3391 | 3382 | | |
3392 | 3383 | | |
| |||
3961 | 3952 | | |
3962 | 3953 | | |
3963 | 3954 | | |
3964 | | - | |
3965 | 3955 | | |
3966 | 3956 | | |
3967 | 3957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
677 | 679 | | |
678 | 680 | | |
679 | 681 | | |
| |||
782 | 784 | | |
783 | 785 | | |
784 | 786 | | |
785 | | - | |
| 787 | + | |
786 | 788 | | |
787 | 789 | | |
788 | 790 | | |
| |||
807 | 809 | | |
808 | 810 | | |
809 | 811 | | |
| 812 | + | |
| 813 | + | |
810 | 814 | | |
811 | 815 | | |
812 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
0 commit comments