From 9740c0a197dc41f816b6ac72d379ed12ed0d4f01 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 19 Jul 2018 20:29:36 -0400 Subject: WIP: Fix new-luxc's JVM back-end. [Part 2] --- stdlib/source/lux/language/compiler/synthesis.lux | 13 ++++++++++--- .../lux/language/compiler/synthesis/expression.lux | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'stdlib/source') diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/language/compiler/synthesis.lux index baea48c30..f4d7a6407 100644 --- a/stdlib/source/lux/language/compiler/synthesis.lux +++ b/stdlib/source/lux/language/compiler/synthesis.lux @@ -63,10 +63,14 @@ #arity Arity #body s}) +(type: #export (Apply' s) + {#function s + #arguments (List s)}) + (type: #export (Branch s) - (#Case s (Path' s)) (#Let s Register s) - (#If s s s)) + (#If s s s) + (#Case s (Path' s))) (type: #export (Scope s) {#start Register @@ -151,6 +155,9 @@ (type: #export Abstraction (Abstraction' Synthesis)) +(type: #export Apply + (Apply' Synthesis)) + (def: #export unit Text "") (do-template [ ] @@ -248,8 +255,8 @@ [branch/let #..Branch #..Let] [branch/if #..Branch #..If] - [loop/scope #..Loop #..Scope] [loop/recur #..Loop #..Recur] + [loop/scope #..Loop #..Scope] [function/abstraction #..Function #..Abstraction] [function/apply #..Function #..Apply] diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/language/compiler/synthesis/expression.lux index be20b7b0b..999d49b15 100644 --- a/stdlib/source/lux/language/compiler/synthesis/expression.lux +++ b/stdlib/source/lux/language/compiler/synthesis/expression.lux @@ -54,16 +54,6 @@ [tupleS (monad.map @ synthesize (analysis.tuple analysis))] (wrap (#//.Structure (#//.Tuple tupleS))))) - (#analysis.Apply _) - (function.apply (|>> synthesize //.indirectly) analysis) - - (#analysis.Function environmentA bodyA) - (function.function synthesize environmentA bodyA) - - (#analysis.Extension name args) - (extension.apply (|>> synthesize //.indirectly) - [name args]) - (#analysis.Reference reference) (case reference (#reference.Constant constant) @@ -91,4 +81,14 @@ (#analysis.Case inputA branchesAB+) (case.synthesize (|>> synthesize //.indirectly) inputA branchesAB+) + + (#analysis.Apply _) + (function.apply (|>> synthesize //.indirectly) analysis) + + (#analysis.Function environmentA bodyA) + (function.function synthesize environmentA bodyA) + + (#analysis.Extension name args) + (extension.apply (|>> synthesize //.indirectly) + [name args]) )) -- cgit v1.2.3