aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/target/jvm/version.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/meta/compiler/target/jvm/version.lux')
-rw-r--r--stdlib/source/library/lux/meta/compiler/target/jvm/version.lux42
1 files changed, 42 insertions, 0 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/target/jvm/version.lux b/stdlib/source/library/lux/meta/compiler/target/jvm/version.lux
new file mode 100644
index 000000000..8e8b82dcc
--- /dev/null
+++ b/stdlib/source/library/lux/meta/compiler/target/jvm/version.lux
@@ -0,0 +1,42 @@
+(.require
+ [library
+ [lux (.except)
+ [control
+ ["[0]" try]]]]
+ ["[0]" //
+ [encoding
+ ["[1][0]" unsigned (.only U2)]]])
+
+(type .public Version U2)
+(type .public Minor Version)
+(type .public Major Version)
+
+(def .public default_minor
+ Minor
+ (|> 0
+ //unsigned.u2
+ try.trusted))
+
+(with_template [<number> <name>]
+ [(def .public <name>
+ Major
+ (|> <number>
+ //unsigned.u2
+ try.trusted))]
+
+ [45 v1_1]
+ [46 v1_2]
+ [47 v1_3]
+ [48 v1_4]
+ [49 v5_0]
+ [50 v6_0]
+ [51 v7]
+ [52 v8]
+ [53 v9]
+ [54 v10]
+ [55 v11]
+ [56 v12]
+ )
+
+(def .public format
+ //unsigned.format/2)