From feacd79496ae9c76492d5a12d30b78724b642654 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 26 Jul 2022 18:08:04 -0400 Subject: Made inlined functions into first-class macros. --- lux-ruby/commands.md | 2 +- lux-ruby/project.lux | 4 ++-- lux-ruby/source/program.lux | 28 +++++++++++++++------------- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'lux-ruby') diff --git a/lux-ruby/commands.md b/lux-ruby/commands.md index 0546f063f..3ec117745 100644 --- a/lux-ruby/commands.md +++ b/lux-ruby/commands.md @@ -20,7 +20,7 @@ cd ~/lux/lux-ruby/ \ ## Compile Lux's Standard Library's tests using a JVM-based compiler. cd ~/lux/stdlib/ \ && lein clean \ -&& java -jar ~/lux/lux-ruby/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& java -jar ~/lux/lux-ruby/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && RUBY_THREAD_VM_STACK_SIZE=15700000 ruby ~/lux/stdlib/target/program/main.rb ``` diff --git a/lux-ruby/project.lux b/lux-ruby/project.lux index e23b606b2..8d759a09b 100644 --- a/lux-ruby/project.lux +++ b/lux-ruby/project.lux @@ -1,5 +1,5 @@ ["" - ["identity" ["com.github.luxlang" "lux-ruby" "0.6.6-SNAPSHOT"] + ["identity" ["com.github.luxlang" "lux-ruby" "0.7.0-SNAPSHOT"] "description" "A Ruby compiler for Lux." "info" ["url" "https://github.com/LuxLang/lux" "scm" "https://github.com/LuxLang/lux.git" @@ -21,4 +21,4 @@ ["org.jruby" "jruby-complete" "9.2.15.0" "jar"]] - "program" "program"]] + "program" program._]] diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index df8ed9b66..324d4cefc 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -22,20 +22,17 @@ [collection ["[0]" array (.only Array)] ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number (.only hex) ["n" nat] ["i" int] ["[0]" i64]]] - ["[0]" world - ["[0]" file] - ["[1]/[0]" program]] - ["@" target (.only) - ["_" ruby]] [meta + ["@" target (.only) + ["_" ruby]] + [macro + ["^" pattern] + ["[0]" template]] ["[0]" compiler ["[0]" phase (.only Operation Phase) (.use "[1]#[0]" monad)] [reference @@ -57,7 +54,8 @@ [generation ["[0]" reference] ["[0]" ruby (.only) - ["[0]" runtime]]]]]] + ["[0]" runtime] + ["[1]/[0]" reference]]]]]] [default ["[0]" platform (.only Platform)]] [meta @@ -65,7 +63,10 @@ ["[0]" context] ["[0]" cli] ["[0]" packager - ["[1]" ruby]]]]]]] + ["[1]" ruby]]]]] + ["[0]" world + ["[0]" file] + ["[1]/[0]" environment]]]] [program ["/" compositor]]) @@ -966,7 +967,7 @@ platform.#phase_wrapper ..phase_wrapper platform.#write (|>> _.code (at utf8.codec encoded))]))) -(def (program context program) +(def (lux_program context program) (Program _.Expression _.Statement) (let [normal_runtime? (_.do "const_defined?" (list (_.string (_.code _.command_line_arguments))) @@ -981,7 +982,7 @@ (def (declare_success! _) (-> Any (Async Any)) - (async.future (at world/program.default exit +0))) + (async.future (at world/environment.default exit +0))) (def (lux_compiler it) (-> Any platform.Custom) @@ -998,7 +999,8 @@ ..platform generation.bundle (function.constant extension/bundle.empty) - ..program + ..lux_program + (reference.constant ruby/reference.system) [Register _.Expression _.Statement] ..extender service -- cgit v1.2.3