aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/synthesis/expression.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/synthesis/expression.lux')
-rw-r--r--new-luxc/source/luxc/lang/synthesis/expression.lux12
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)))