From 6b6901b31bbec9947522a94274cd11c8e7683168 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 28 Jan 2018 19:41:01 -0400 Subject: - Got JS backend to build with the rest of the new-luxc code. --- new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux index 82c8c0ec0..67a6935ba 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux @@ -21,6 +21,7 @@ [".T" case] [".T" procedure])) +(exception: #export Invalid-Function-Syntax) (exception: #export Unrecognized-Synthesis) (def: #export (translate synthesis) @@ -62,9 +63,13 @@ (^code ("lux case" (~ inputS) (~ pathPS))) (caseT.translate-case translate inputS pathPS) - (^multi (^code ("lux function" (~ [_ (#.Nat arity)]) [(~+ environment)] (~ bodyS))) - [(s.run environment (p.some s.int)) (#e.Success environment)]) - (functionT.translate-function translate environment arity bodyS) + (^code ("lux function" (~ [_ (#.Nat arity)]) [(~+ environment)] (~ bodyS))) + (case (s.run environment (p.some s.int)) + (#e.Success environment) + (functionT.translate-function translate environment arity bodyS) + + _ + (&.throw Invalid-Function-Syntax (%code synthesis))) (^code ("lux call" (~ functionS) (~+ argsS))) (functionT.translate-call translate functionS argsS) -- cgit v1.2.3