aboutsummaryrefslogtreecommitdiff
path: root/compatibility/4.11.nom
diff options
context:
space:
mode:
Diffstat (limited to 'compatibility/4.11.nom')
-rw-r--r--compatibility/4.11.nom24
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