aboutsummaryrefslogtreecommitdiff
path: root/compatibility/4.10.12.7.nom
blob: 4c363ab0f9e52e67c69ed3357255fb23f42b3b1f (plain)
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
#!/usr/bin/env nomsu -V4.10.12.7
#
    This file defines upgrades from Nomsu <4.10.12.7 to 4.10.12.7
use "compatibility/compatibility.nom"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

upgrade action (% as lua statements) to "4.10.12.7" as (% as lua)
upgrade action (% as lua return) to "4.10.12.7" as (..)
    =lua "\%.type == 'Block' and \(% as lua) or 'return '..\(% as lua expr)"
upgrade action (Lua value %) to "4.10.12.7" as (Lua %)

upgrade action (%e for % in %items) to "4.10.12.7" as [:for % in %items: add %e]
upgrade action (%e for %k = %v in %items) to "4.10.12.7" as [:for %k = %v in %items: add %e]
upgrade action (%e for %i in %start to %stop) to "4.10.12.7" as [:for %i in %start to %stop: add %e]
upgrade action (%e for %i in %start to %stop by %step) to "4.10.12.7" as (..)
    [:for %i in %start to %stop by %step: add %e]
upgrade action (%e for %i in %start to %stop via %step) to "4.10.12.7" as (..)
    [:for %i in %start to %stop by %step: add %e]

upgrade action (%k = %v for % in %items) to "4.10.12.7" as {:for % in %items: add %k = %v}
upgrade action (%k = %v for %k0 = %v0 in %items) to "4.10.12.7" as {:for %k0 = %v0 in %items: add %k = %v}
upgrade action (%k = %v for %i in %start to %stop) to "4.10.12.7" as {:for %i in %start to %stop: add %k = %v}
upgrade action (%k = %v for %i in %start to %stop by %step) to "4.10.12.7" as (..)
    {:for %i in %start to %stop by %step: add %k = %v}
upgrade action (%k = %v for %i in %start to %stop via %step) to "4.10.12.7" as (..)
    {:for %i in %start to %stop by %step: add %k = %v}

upgrade action (% as lua statements) to "4.10.12.7" as (% as lua)
upgrade action (compile error at %pos %err hint %hint) to "4.10.12.7" as (..)
    compile error at %pos %err %hint

upgrade %tree to "4.10.12.7" as:
    if (%tree.type == "FileChunks"):
        %first_chunk = %tree.1
        %first_has_use = (no)
        %i = 1
        repeat while (%i < (size of %first_chunk)):
            if %first_has_use:
                if ((%first_chunk.%i.type != "Action") or (%first_chunk.%i.stub != "use")):
                    %chunk2 = (%SyntaxTree {type:"Block"})
                    for %j in %i to (size of %first_chunk.%i):
                        %chunk2.((size of %chunk2) + 1) = %first_chunk.%i.%j
                    for %j in %i to (size of %first_chunk.%i):
                        %first_chunk.%i.%j = (nil)
                    %table.insert %tree 2 %chunk2
                    return %tree
            ..else:
                if ((%first_chunk.type == "Action") and (%first_chunk.stub == "use")):
                    %first_has_use = (yes)
            %i += 1