From af3e6e2cb011dc2ad9204440990731a2f272716d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 12 Jun 2021 01:32:40 -0400 Subject: Constraining the year of the snapshot time in Aedifex. --- .../source/luxc/lang/translation/jvm/runtime.lux | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm/runtime.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux index 782187339..95cfd9e5a 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux @@ -20,7 +20,7 @@ ["." category (#+ Void Value' Value Return' Return Primitive Object Class Array Var Parameter Method)] ["." reflection]]]] [tool - [compiler (#+ Output) + [compiler [arity (#+ Arity)] ["." phase] [language @@ -28,7 +28,7 @@ ["." synthesis] ["." generation]]] [meta - [archive + [archive (#+ Output) ["." artifact (#+ Registry)]]]]]] [luxc [lang @@ -334,8 +334,11 @@ (-> (Type (<| Return' Value' category)) Text)) (|>> type.reflection reflection.reflection)) +(def: runtime_id + 0) + (def: translate_runtime - (Operation [Text Binary]) + (Operation [artifact.ID Binary]) (let [runtime_class (..reflection //.$Runtime) bytecode ($d.class #$.V1_6 #$.Public $.finalC runtime_class (list) (type.class "java.lang.Object" (list)) (list) (|>> adt_methods @@ -345,11 +348,14 @@ directive [runtime_class bytecode]] (do phase.monad [_ (generation.execute! directive) - _ (generation.save! "0" directive)] - (wrap ["0" bytecode])))) + _ (generation.save! ..runtime_id directive)] + (wrap [..runtime_id bytecode])))) + +(def: function_id + 1) (def: translate_function - (Operation [Text Binary]) + (Operation [artifact.ID Binary]) (let [applyI (|> (enum.range n.enum 2 num_apply_variants) (list@map (function (_ arity) ($d.method #$.Public $.noneM apply_method (apply_signature arity) @@ -379,8 +385,8 @@ directive [function_class bytecode]] (do phase.monad [_ (generation.execute! directive) - _ (generation.save! "1" directive)] - (wrap ["1" bytecode])))) + _ (generation.save! ..function_id directive)] + (wrap [..function_id bytecode])))) (def: #export translate (Operation [Registry Output]) -- cgit v1.2.3