Skip to content

Commit

Permalink
Improvement to syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Sep 27, 2024
1 parent 54e3bd5 commit 2e10b7d
Show file tree
Hide file tree
Showing 843 changed files with 5,412 additions and 5,436 deletions.
12 changes: 6 additions & 6 deletions lux-c++/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[program (.only program)]
["[0]" ffi (.only import)]
[abstract
[monad (.only do)]]
["[0]" monad]]
[concurrency
["[0]" atom]]
[control
Expand Down Expand Up @@ -207,7 +207,7 @@
(.log!# "[evaluate!]")
(.log!# (..nested (_.code definition)))
(io.value
(do (try.with io.monad)
(monad.let (try.with io.monad)
[_ (cppyy::cppdef (_.code definition))
.let [globals (io.value (cppyy::gbl))
it (lux_value (..runtime globals)
Expand All @@ -229,7 +229,7 @@
(let [global (maybe.else (reference.artifact context)
custom)
@global (_.local global)]
(do try.monad
(monad.let try.monad
[.let [definition (<| (_.namespace {.#None})
(_.constant @global /runtime.value_type)
input)]
Expand All @@ -249,7 +249,7 @@
(execute! content))

(the (re_load context custom content)
(do try.monad
(monad.let try.monad
[_ (execute! content)]
(evaluate! [{.#None} (_.local (reference.artifact context))]))))))))

Expand All @@ -260,7 +260,7 @@
(the .public platform
(IO [/runtime.Host
(Platform /runtime.Anchor /runtime.Value /runtime.Declaration)])
(do io.monad
(monad.let io.monad
[host ..host]
(pure [host
[platform.#file_system (file.future file.default)
Expand Down Expand Up @@ -293,7 +293,7 @@
(program [service cli.service]
(let [context (context.c++ (cli.target service))]
(exec
(do future.monad
(monad.let future.monad
[[host platform] (future.soon ..platform)
_ (compositor.compiler (|>> (as platform.Custom))
context
Expand Down
18 changes: 9 additions & 9 deletions lux-cl/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
["[0]" ffi]
["[0]" debug]
[abstract
[monad (.only do)]]
["[0]" monad]]
[control
["[0]" pipe]
["[0]" maybe]
Expand Down Expand Up @@ -237,7 +237,7 @@
(the (read_variant read host_object)
(-> (Reader org/armedbear/lisp/LispObject)
(Reader org/armedbear/lisp/Cons))
(do try.monad
(monad.let try.monad
[tag (read (org/armedbear/lisp/LispObject::NTH +0 host_object))
value (read (org/armedbear/lisp/LispObject::NTH +2 host_object))]
(wrap [(java/lang/Long::intValue (as java/lang/Long tag))
Expand Down Expand Up @@ -304,7 +304,7 @@
(the (call_macro inputs lux macro)
(-> (Stack Code) Lux org/armedbear/lisp/Closure
(Try (Try [Lux (Stack Code)])))
(do try.monad
(monad.let try.monad
[raw_output (org/armedbear/lisp/LispObject::execute (..host_value inputs) (..host_value lux) macro)]
(as (Try (Try [Lux (Stack Code)]))
(..read raw_output))))
Expand All @@ -324,7 +324,7 @@
interpreter (org/armedbear/lisp/Interpreter::getInstance)
value (is (-> (_.Code Any) (Try Any))
(function (_ code)
(do try.monad
(monad.let try.monad
[host_value (org/armedbear/lisp/Interpreter::eval (_.code code) interpreter)]
(read host_value))))]
(is (Host (_.Expression Any) (_.Expression Any))
Expand All @@ -338,7 +338,7 @@
(the (define! context input)
(let [global (reference.artifact context)
@global (_.var global)]
(do try.monad
(monad.let try.monad
[#let [definition (_.defparameter @global input)]
_ (org/armedbear/lisp/Interpreter::eval (_.code definition) interpreter)
value (value @global)]
Expand All @@ -354,14 +354,14 @@
(value content))

(the (re_load context content)
(do try.monad
(monad.let try.monad
[_ (value content)]
(value (_.var (reference.artifact context)))))
)))))

(the platform
(IO (Platform [_.Tag Register] (_.Expression Any) (_.Expression Any)))
(do io.monad
(monad.let io.monad
[host ..host]
(wrap [platform.#file_system (file.future file.default)
platform.#host host
Expand Down Expand Up @@ -436,9 +436,9 @@
(`` (the _
(program [service /cli.service]
(let [extension ".cl"]
(do io.monad
(monad.let io.monad
[platform ..platform]
(exec (do future.monad
(exec (monad.let future.monad
[_ (/.compiler [/static.#host .common_lisp
/static.#host_module_extension extension
/static.#target (/cli.target service)
Expand Down
26 changes: 13 additions & 13 deletions lux-js/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
["[0]" ffi (.only import)]
["[0]" debug]
[abstract
[monad (.only do)]]
["[0]" monad]]
[control
["[0]" maybe (.use "[1]#[0]" monad)]
["[0]" io (.only IO io)]]
Expand Down Expand Up @@ -481,7 +481,7 @@

(the (ensure_function function)
(-> Any (Maybe org/openjdk/nashorn/api/scripting/JSObject))
(do maybe.monad
(monad.let maybe.monad
[function (|> function
(as (-> Any java/lang/Object))
(ffi.as org/openjdk/nashorn/api/scripting/JSObject))]
Expand Down Expand Up @@ -540,7 +540,7 @@
(for .jvm
(these (the (evaluate! interpreter input)
(-> javax/script/ScriptEngine _.Expression (Try Any))
(do try.monad
(monad.let try.monad
[?output (javax/script/ScriptEngine::eval [(ffi.as_string (_.code input))] interpreter)]
(when ?output
{.#Some output}
Expand All @@ -551,7 +551,7 @@

(the (execute! interpreter input)
(-> javax/script/ScriptEngine _.Statement (Try Any))
(do try.monad
(monad.let try.monad
[?output (javax/script/ScriptEngine::eval [(ffi.as_string (_.code input))] interpreter)]
(pure [])))

Expand All @@ -560,7 +560,7 @@
(let [global (maybe.else (reference.artifact context)
custom)
@global (_.var global)]
(do try.monad
(monad.let try.monad
[.let [definition (_.define @global input)]
_ (execute! interpreter definition)
value (evaluate! interpreter @global)]
Expand All @@ -586,7 +586,7 @@
(..execute! interpreter content))

(the (re_load context custom content)
(do try.monad
(monad.let try.monad
[_ (..execute! interpreter content)]
(..evaluate! interpreter (_.var (reference.artifact context))))))))))
)
Expand All @@ -604,7 +604,7 @@

(the (evaluate! input)
(-> _.Expression (Try Any))
(do try.monad
(monad.let try.monad
[?output (..eval (_.code input))]
(when ?output
{.#Some output}
Expand All @@ -615,7 +615,7 @@

(the (execute! input)
(-> _.Statement (Try Any))
(do try.monad
(monad.let try.monad
[?output (..eval (_.code input))]
(pure [])))

Expand All @@ -624,7 +624,7 @@
(let [global (maybe.else (reference.artifact context)
custom)
@global (_.var global)]
(do try.monad
(monad.let try.monad
[.let [definition (_.define @global input)]
_ (..execute! definition)
value (..evaluate! @global)]
Expand All @@ -648,7 +648,7 @@
(..execute! content))

(the (re_load context custom content)
(do try.monad
(monad.let try.monad
[_ (..execute! content)]
(..evaluate! (_.var (reference.artifact context)))))))))
))
Expand All @@ -668,7 +668,7 @@

(the platform
(IO (Platform [Register Text] _.Expression _.Statement))
(do io.monad
(monad.let io.monad
[host ..host]
(pure [platform.#file_system (for .jvm (file.future file.default)
... TODO: Handle this in a safer manner.
Expand Down Expand Up @@ -709,7 +709,7 @@
(as (-> Any Try))
try.trusted
(as (-> Any Try))
(do try.monad
(monad.let try.monad
[handler (try.of_maybe "Not an extension handler."
(..ensure_function handler))
.let [to_js (is (-> Any java/lang/Object)
Expand Down Expand Up @@ -748,7 +748,7 @@
(program [service cli.service]
(let [context (context.js (cli.target service))]
(exec
(do future.monad
(monad.let future.monad
[platform (future.soon ..platform)
_ (/.compiler ..lux_compiler
context
Expand Down
10 changes: 5 additions & 5 deletions lux-jvm/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[program (.only program)]
["[0]" ffi (.only import)]
[abstract
[monad (.only do)]]
["[0]" monad]]
[concurrency
["[0]" future (.only Future)]]
[control
Expand Down Expand Up @@ -87,7 +87,7 @@

(the .public (expander macro inputs lux)
Expander
(do try.monad
(monad.let try.monad
[of_method (|> macro
(as (-> Macro java/lang/Object))
(java/lang/Object::getClass [])
Expand All @@ -108,7 +108,7 @@
(IO [java/lang/ClassLoader
/runtime.Host
(Platform Anchor (Bytecode Any) Definition)])
(do io.monad
(monad.let io.monad
[[loader host] /host.host]
(pure [loader
host
Expand All @@ -131,7 +131,7 @@
(as (-> Any Try))
try.trusted
(as (-> Any Try))
(do try.monad
(monad.let try.monad
[method (|> handler
(as (-> Any java/lang/Object))
(java/lang/Object::getClass [])
Expand All @@ -153,7 +153,7 @@
(program [service cli.service]
(let [context (context.jvm (cli.target service))]
(exec
(do future.monad
(monad.let future.monad
[[loader host platform] (future.soon ..platform)
_ (compositor.compiler (|>> (as (-> Any platform.Custom)))
context
Expand Down
Loading

0 comments on commit 2e10b7d

Please sign in to comment.