aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/host/jvm/version.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/host/jvm/version.lux')
-rw-r--r--stdlib/source/lux/host/jvm/version.lux38
1 files changed, 38 insertions, 0 deletions
diff --git a/stdlib/source/lux/host/jvm/version.lux b/stdlib/source/lux/host/jvm/version.lux
new file mode 100644
index 000000000..aca98e990
--- /dev/null
+++ b/stdlib/source/lux/host/jvm/version.lux
@@ -0,0 +1,38 @@
+(.module:
+ [lux #*
+ [data
+ [format
+ ["." binary (#+ Format)]]]]
+ [//
+ ["//." encoding (#+ U2)]])
+
+(type: #export Version U2)
+(type: #export Minor Version)
+(type: #export Major Version)
+
+(def: #export version
+ (-> Nat Version)
+ //encoding.to-u2)
+
+(do-template [<name> <number>]
+ [(def: #export <name>
+ Major
+ (..version <number>))]
+
+ [v1_1 45]
+ [v1_2 46]
+ [v1_3 47]
+ [v1_4 48]
+ [v5_0 49]
+ [v6_0 50]
+ [v7 51]
+ [v8 52]
+ [v9 53]
+ [v10 54]
+ [v11 55]
+ [v12 56]
+ )
+
+(def: #export format
+ (Format Version)
+ //encoding.u2-format)