From 464b6e8f5e6c62f58fa8c7ff61ab2ad215e98bd1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 9 Aug 2021 23:02:01 -0400 Subject: Improved single-line comment syntax (from "##" to "..."). --- .../source/luxc/lang/translation/jvm/common.lux | 126 ++++++++++----------- 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm/common.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index 65714f909..283081608 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -1,73 +1,73 @@ (.module: [library [lux #* - ## [abstract - ## [monad (#+ do)]] - ## [control - ## ["." try (#+ Try)] - ## ["ex" exception (#+ exception:)] - ## ["." io]] - ## [data - ## [binary (#+ Binary)] - ## ["." text ("#/." hash) - ## format] - ## [collection - ## ["." dictionary (#+ Dictionary)]]] - ## ["." macro] - ## [host (#+ import:)] - ## [tool - ## [compiler - ## [reference (#+ Register)] - ## ["." name] - ## ["." phase]]] + ... [abstract + ... [monad (#+ do)]] + ... [control + ... ["." try (#+ Try)] + ... ["ex" exception (#+ exception:)] + ... ["." io]] + ... [data + ... [binary (#+ Binary)] + ... ["." text ("#/." hash) + ... format] + ... [collection + ... ["." dictionary (#+ Dictionary)]]] + ... ["." macro] + ... [host (#+ import:)] + ... [tool + ... [compiler + ... [reference (#+ Register)] + ... ["." name] + ... ["." phase]]] ]] - ## [luxc - ## [lang - ## [host - ## ["." jvm - ## [type]]]]] + ... [luxc + ... [lang + ... [host + ... ["." jvm + ... [type]]]]] ) -## (def: .public (with-artifacts action) -## (All [a] (-> (Meta a) (Meta [Artifacts a]))) -## (function (_ state) -## (case (action (update@ #.host -## (|>> (:coerce Host) -## (set@ #artifacts (dictionary.new text.hash)) -## (:coerce Nothing)) -## state)) -## (#try.Success [state' output]) -## (#try.Success [(update@ #.host -## (|>> (:coerce Host) -## (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) -## (:coerce Nothing)) -## state') -## [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) -## output]]) +... (def: .public (with-artifacts action) +... (All [a] (-> (Meta a) (Meta [Artifacts a]))) +... (function (_ state) +... (case (action (update@ #.host +... (|>> (:coerce Host) +... (set@ #artifacts (dictionary.new text.hash)) +... (:coerce Nothing)) +... state)) +... (#try.Success [state' output]) +... (#try.Success [(update@ #.host +... (|>> (:coerce Host) +... (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) +... (:coerce Nothing)) +... state') +... [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) +... output]]) -## (#try.Failure error) -## (#try.Failure error)))) +... (#try.Failure error) +... (#try.Failure error)))) -## (def: .public (load-definition state) -## (-> Lux (-> Name Binary (Try Any))) -## (function (_ (^@ def-name [def-module def-name]) def-bytecode) -## (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) -## class-name (format (text.replace-all "/" "." def-module) "." normal-name)] -## (<| (macro.run state) -## (do macro.monad -## [_ (..store-class class-name def-bytecode) -## class (..load-class class-name)] -## (case (do try.monad -## [field (Class::getField [..value-field] class)] -## (Field::get [#.None] field)) -## (#try.Success (#.Some def-value)) -## (wrap def-value) +... (def: .public (load-definition state) +... (-> Lux (-> Name Binary (Try Any))) +... (function (_ (^@ def-name [def-module def-name]) def-bytecode) +... (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) +... class-name (format (text.replace-all "/" "." def-module) "." normal-name)] +... (<| (macro.run state) +... (do macro.monad +... [_ (..store-class class-name def-bytecode) +... class (..load-class class-name)] +... (case (do try.monad +... [field (Class::getField [..value-field] class)] +... (Field::get [#.None] field)) +... (#try.Success (#.Some def-value)) +... (wrap def-value) -## (#try.Success #.None) -## (phase.throw invalid-definition-value (%name def-name)) +... (#try.Success #.None) +... (phase.throw invalid-definition-value (%name def-name)) -## (#try.Failure error) -## (phase.throw cannot-load-definition -## (format "Definition: " (%name def-name) "\n" -## "Error:\n" -## error)))))))) +... (#try.Failure error) +... (phase.throw cannot-load-definition +... (format "Definition: " (%name def-name) "\n" +... "Error:\n" +... error)))))))) -- cgit v1.2.3