From 461a6ce673de9b2c3d77714c4884c2a316fe7e8f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 20 Jul 2021 16:19:43 -0400 Subject: Updated the Scriptum documentation generator. --- lux-jvm/source/luxc/lang/directive/jvm.lux | 3 +- .../luxc/lang/translation/jvm/extension/host.lux | 32 ++++++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) (limited to 'lux-jvm/source/luxc') diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index b03cf6bbc..3ebcfe641 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -29,7 +29,8 @@ ["#." type (#+ Type) [category (#+ Void Value Return Method Primitive Object Class Array Var Parameter Declaration)] ["." parser] - ["#/." signature]]]] + ["#/." signature] + ["#/." descriptor]]]] [tool [compiler ["." phase] diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux index a9727fc9a..33552c135 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -29,6 +29,7 @@ ["." box] ["." reflection] ["." signature] + ["." descriptor] ["." parser]]]] [tool [compiler @@ -76,9 +77,17 @@ [return Return parser.return] ) +(def: signature + (All [a] (-> (Type a) Text)) + (|>> type.signature signature.signature)) + +(def: descriptor + (All [a] (-> (Type a) Text)) + (|>> type.descriptor descriptor.descriptor)) + (exception: #export (not_an_object_array {arrayJT (Type Array)}) (exception.report - ["JVM Type" (|> arrayJT type.signature signature.signature)])) + ["JVM Type" (..signature arrayJT)])) (def: #export object_array (Parser (Type Object)) @@ -558,18 +567,18 @@ (^ (list (synthesis.text from) (synthesis.text to) valueS)) (do phase.monad [valueI (generate archive valueS)] - (`` (cond (~~ (template [ ] - [(and (text@= (reflection.reflection (type.reflection )) + (`` (cond (~~ (template [ ] + [(and (text@= (reflection.reflection (type.reflection )) from) (text@= to)) - (wrap (|>> valueI (_.wrap ))) + (wrap (|>> valueI (_.wrap ))) (and (text@= from) - (text@= (reflection.reflection (type.reflection )) + (text@= (reflection.reflection (type.reflection )) to)) - (wrap (|>> valueI (_.unwrap )))] + (wrap (|>> valueI (_.unwrap )))] [box.boolean type.boolean] [box.byte type.byte] @@ -960,8 +969,13 @@ (#.Left returnT) (case (type.primitive? returnT) (#.Left returnT) - (|>> (_.CHECKCAST returnT) - _.ARETURN) + (case (type.class? returnT) + (#.Some class_name) + (|>> (_.CHECKCAST returnT) + _.ARETURN) + + #.None + _.ARETURN) (#.Right returnT) (cond (or (\ type.equivalence = type.boolean returnT) @@ -1043,7 +1057,7 @@ ($_ $.++M $.finalM $.strictM) $.finalM) name - (type.method [(list) + (type.method [vars (list@map product.right arguments) returnT exceptionsT]) -- cgit v1.2.3