aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2019-04-09 18:59:33 -0400
committerEduardo Julian2019-04-09 18:59:33 -0400
commit6c3e9f8c02ce153380392ba5bc8eeb517de5f781 (patch)
tree758b5cfa843b040421299e8dfcd115ae3b79067d /stdlib
parent1a8f93c02a68d7b3968916c14155a391871d6340 (diff)
WIP: Ruby compiler.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/host/ruby.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux6
5 files changed, 6 insertions, 8 deletions
diff --git a/stdlib/source/lux/host/ruby.lux b/stdlib/source/lux/host/ruby.lux
index 6bf113ed0..8f54bbdeb 100644
--- a/stdlib/source/lux/host/ruby.lux
+++ b/stdlib/source/lux/host/ruby.lux
@@ -57,8 +57,6 @@
[Literal Computation]
[Access Location]
- [Loop Statement]
- [Label Code]
)
(template [<var> <brand> <prefix> <constructor>]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
index 7bc52c318..01b405dff 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux
@@ -41,7 +41,7 @@
(wrap (|> bodyO
_.return
(_.lambda #.None (list (..register register)))
- (_.apply/* (list valueO))))))
+ (_.do "call" (list valueO))))))
(def: #export (record-get generate valueS pathP)
(-> Phase Synthesis (List (Either Nat Nat))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
index 486b68592..be12aa2e2 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux
@@ -29,7 +29,7 @@
(do ////.monad
[functionO (generate functionS)
argsO+ (monad.map @ generate argsS+)]
- (wrap (_.apply/* argsO+ functionO))))
+ (wrap (_.do "call" argsO+ functionO))))
(def: #export capture
(///reference.foreign _.local))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
index 6ff021863..a5dcc1302 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux
@@ -7,5 +7,5 @@
["." reference]]])
(def: #export system
- (reference.system (: (-> Text (Expression Any)) _.local)
+ (reference.system (: (-> Text (Expression Any)) _.global)
(: (-> Text (Expression Any)) _.local)))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
index b3dcbd8ee..e39e6af8e 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux
@@ -162,9 +162,9 @@
(runtime: (sum//get sum wantsLast wantedTag)
(let [no-match! (_.return _.nil)
- sum-tag (_.nth (_.int +0) sum)
- sum-flag (_.nth (_.int +1) sum)
- sum-value (_.nth (_.int +2) sum)
+ sum-tag (_.nth (_.string ..variant-tag-field) sum)
+ sum-flag (_.nth (_.string ..variant-flag-field) sum)
+ sum-value (_.nth (_.string ..variant-value-field) sum)
is-last? (_.= (_.string "") sum-flag)
test-recursion! (_.if is-last?
## Must recurse.