aboutsummaryrefslogtreecommitdiff
path: root/lib/compatibility/compatibility.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-02-06 15:33:10 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-02-06 15:34:00 -0800
commit057f5b74ebb7851f6ba824129b3e3316cae23260 (patch)
tree2561ca637f5db834cb8f8b82831cbbbbc26d71ae /lib/compatibility/compatibility.nom
parent618e48ad98c0e2b36eb22c75251dddc141d822e6 (diff)
Moving to better, more centralized versioning system. Now the Nomsu
version is just defined as a list at the top of nomsu.moon, and uses X.Y.Z form instead of X.Y.Z.W. Added a ([...], from 2) method and a ([...], up to 5) method, and fixed a few upgrade bugs.
Diffstat (limited to 'lib/compatibility/compatibility.nom')
-rw-r--r--lib/compatibility/compatibility.nom17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/compatibility/compatibility.nom b/lib/compatibility/compatibility.nom
index a7ca0c1..c1c83d3 100644
--- a/lib/compatibility/compatibility.nom
+++ b/lib/compatibility/compatibility.nom
@@ -70,8 +70,15 @@ external:
$tree upgraded to $end_version from $start_version
] all mean:
unless ($tree is syntax tree): return $tree
- ($ver as version list) means (($ as number) for $ in $ver matching "[0-9]+")
+ ($ver as version list) means:
+ if ($ver is "Text"):
+ return (($ as number) for $ in $ver matching "[0-9]+")
+ return $ver
(Ver $) means:
+ if ($ is "a List"):
+ if ($.1 is "Text"):
+ return {.lib = $.1, .version = ($, from 2)}
+ return {.version = $}
[$lib, $ver] = ($, match "(.*)/([0-9.]+)")
if $lib:
return {.lib = $lib, .version = ($ver as version list)}
@@ -117,15 +124,15 @@ external:
$tree = (SyntaxTree {: for $k = $v in $tree: add $k = $v})
$tree.version = $end_version
if $tree.shebang:
- $tree.shebang = "#!/usr/bin/env nomsu -V\$end_version\n"
+ $tree.shebang = "#!/usr/bin/env nomsu -V\($end_version, joined with ".")\n"
return $tree
($tree upgraded from $start_version) means
- $tree upgraded from $start_version to (Nomsu version)
+ $tree upgraded from $start_version to $(NOMSU VERSION)
($tree upgraded to $end_version) means
- $tree upgraded from ($tree.version or (Nomsu version)) to $end_version
+ $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)
+ $tree upgraded from ($tree.version or $(NOMSU VERSION)) to $(NOMSU VERSION)