From f523bc14d43286348aeb200bd0554812dc6ef28d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 8 Jan 2018 21:29:02 -0400 Subject: - Now using synthesis extensions during synthesis. --- new-luxc/source/luxc/lang/synthesis/expression.lux | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/lang/synthesis/expression.lux') diff --git a/new-luxc/source/luxc/lang/synthesis/expression.lux b/new-luxc/source/luxc/lang/synthesis/expression.lux index b31a146a1..2dbf8ed5a 100644 --- a/new-luxc/source/luxc/lang/synthesis/expression.lux +++ b/new-luxc/source/luxc/lang/synthesis/expression.lux @@ -12,6 +12,7 @@ ["s" syntax])) (luxc (lang ["la" analysis] ["ls" synthesis] + [".L" extension #+ Syntheses] (synthesis [".S" case] [".S" function] [".S" loop]) @@ -113,8 +114,8 @@ _ (call$ funcS argsS)))) -(def: #export (synthesize expressionA) - (-> la.Analysis ls.Synthesis) +(def: #export (synthesize syntheses expressionA) + (-> Syntheses la.Analysis ls.Synthesis) (loop [arity +0 resolver init-resolver direct? false @@ -190,7 +191,12 @@ (synthesize-apply (recur arity resolver false num-locals) num-locals expressionA) (^code ((~ [_ (#.Text name)]) (~+ args))) - (procedure$ name (list/map (recur arity resolver false num-locals) args)) + (case (dict.get name syntheses) + #.None + (procedure$ name (list/map (recur arity resolver false num-locals) args)) + + (#.Some synthesis) + (synthesis (recur arity resolver false num-locals) args)) _ expressionA))) -- cgit v1.2.3