diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-22 14:25:18 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-22 14:25:18 -0700 |
| commit | 7f30fb293f11744eaab6935e791c5aa993411722 (patch) | |
| tree | be8bf8845583b89c0502dd32c2a8d2d1b65924cc /lib/compatibility/compatibility.nom | |
| parent | be9a86d639d0f676f63a5c540d4a0d0d2b2d3c6e (diff) | |
Fixed a bunch of compatibility issues that made upgrading really slow,
especially when upgrading across many versions.
Diffstat (limited to 'lib/compatibility/compatibility.nom')
| -rw-r--r-- | lib/compatibility/compatibility.nom | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/compatibility/compatibility.nom b/lib/compatibility/compatibility.nom index 4715282..01ba24f 100644 --- a/lib/compatibility/compatibility.nom +++ b/lib/compatibility/compatibility.nom @@ -17,7 +17,7 @@ external: $ACTION_UPGRADES.$version.$stub = $upgrade_fn (upgrade $tree to $version as $body) parses as - upgrade to $version via (($ $end_version) -> ($, with ($tree -> $body))) + upgrade to $version via ($ -> ($, with ($tree -> $body))) (upgrade action $actions to $version as $body) compiles to: if ($actions is "Action" syntax tree): @@ -97,31 +97,31 @@ external: for ($v = $) in $ACTION_UPGRADES: $versions.$v = (yes) - $versions = - [: for ($v = $) in $versions: if ((Ver $v).lib == $start.lib): add $v] + $versions = [: + for ($v = $) in $versions: + $v2 = (Ver $v) + if ($v2.lib == $start.lib): + if ($start.version < $v2.version <= $end.version): add $v + ] sort $versions by $ -> ($ as version list) + $curr_version = $start_version for $ver in $versions: - if (($ver as version list) <= $start.version): do next $ver - if (($ver as version list) > $end.version): stop $ver - if $ACTION_UPGRADES.$ver: - $tree = - $tree, with - $ ->: - if ($ is "Action" syntax tree): - $(upgrade 1 to 2) = $ACTION_UPGRADES.$ver.($.stub) - if $(upgrade 1 to 2): - $with_upgraded_args = {: for ($k = $v) in $: add $k = ($v upgraded from $start_version to $end_version)} - set $with_upgraded_args's metatable to ($'s metatable) - return (upgrade $with_upgraded_args to $end_version) + $tree = + SyntaxTree + {: for ($k = $v) in $tree: add $k = ($v upgraded from $curr_version to $ver)} + if (($tree.type == "Action") and $ACTION_UPGRADES.$ver): + $(upgrade 1) = $ACTION_UPGRADES.$ver.($tree, get stub) + if $(upgrade 1): + $tree = (upgrade $tree) + go to (next version) if $UPGRADES.$ver: - $with_upgraded_args = {: - for ($k = $v) in $tree: - add $k = ($v upgraded from $start_version to $end_version) - } - set $with_upgraded_args's metatable to ($tree's metatable) - $tree = ($UPGRADES.$ver $with_upgraded_args $end_version) + $tree = ($UPGRADES.$ver $tree $ver) + go to (next version) + + --- (next version) --- + $curr_version = $ver if ($tree.version != $end_version): $tree = (SyntaxTree {: for ($k = $v) in $tree: add $k = $v}) @@ -138,4 +138,4 @@ external: $tree upgraded from ($tree.version or $(NOMSU VERSION)) to $end_version ($tree upgraded) means - $tree upgraded from ($tree.version or $(NOMSU VERSION)) to $(NOMSU VERSION)
\ No newline at end of file + $tree upgraded from ($tree.version or $(NOMSU VERSION)) to $(NOMSU VERSION) |
