diff options
author | Eduardo Julian | 2018-01-08 21:29:02 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-01-08 21:29:02 -0400 |
commit | f523bc14d43286348aeb200bd0554812dc6ef28d (patch) | |
tree | 58876df8fc7b6ec9384c8ed4239a290567120542 /new-luxc/source/luxc/lang/synthesis | |
parent | b7d53027deeb185fa7b4312ba7079aa566762513 (diff) |
- Now using synthesis extensions during synthesis.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/synthesis/expression.lux | 12 |
1 files changed, 9 insertions, 3 deletions
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))) |