diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:38:05 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:39:08 -0800 |
| commit | 7f47d4204039258cec78c767f489b7809b4257ff (patch) | |
| tree | c8533068b75ab453accfe1f688705e9e94c9e279 /compatibility/4.11.nom | |
| parent | 34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff) | |
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'compatibility/4.11.nom')
| -rw-r--r-- | compatibility/4.11.nom | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/compatibility/4.11.nom b/compatibility/4.11.nom index 320fe5e..fdf6660 100644 --- a/compatibility/4.11.nom +++ b/compatibility/4.11.nom @@ -1,12 +1,34 @@ #!/usr/bin/env nomsu -V4.11 # This file defines upgrades from Nomsu <4.11 to Nomsu 4.11 - (deleting (if all of ...), etc. shorthand) + (overhaul of function literals, deleting (if all of ...), etc. shorthand) use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Overhaul of function literals: +upgrade action "call 1 with" to "4.11" via (..) + for (%tree %end_version): + %tree2 = {type: "Action", source: %tree.source, 1: %tree.2} + for %arg in %tree.4 at %i: + %tree2.(%i + 1) = %arg + return (SyntaxTree %tree2) + +upgrade action (-> %yield_value) to "4.11" as (yield %yield_value) + +# Replace set {%x:1, %y:2} with [%x, %y] = [1, 2] +upgrade action "set" to "4.11" via (..) + for (%tree %end_version): + [%lhs, %rhs] = [\[], \[]] + %lhs.source = %tree.(2).source + %rhs.source = %tree.(2).source + for %entry in %tree.2 at %i: + %lhs.%i = %entry.1 + %rhs.%i = %entry.2 + return (SyntaxTree {type: "Action", source: %tree.source, 1: %lhs, 2: "=", 3: %rhs}) + +# Deprecating shorthand functions: upgrade action [if all of %items %body, if all of %items then %body] to "4.11" as (..) if (all of %items) %body |
