aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang
diff options
context:
space:
mode:
authorEduardo Julian2017-05-29 22:05:57 -0400
committerEduardo Julian2017-05-29 22:05:57 -0400
commit953f49d5a46209f2d75e67b50edea378261108cd (patch)
treeb2f1c4e08fbbbfa84c5b918ce68e4acbae08efa1 /new-luxc/source/luxc/lang
parent9ca82858b0e15800972ca7b2a776190a8d4b371c (diff)
- Fixes for pattern-matching (case) analysis.
- Small refactorings. - Improved common procedures analysis. - Can now handle tagged structures (variants & records). - Tests for pattern-matching, functions (definition & application), and common procedures.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/analysis.lux4
-rw-r--r--new-luxc/source/luxc/lang/synthesis.lux8
2 files changed, 7 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/analysis.lux b/new-luxc/source/luxc/lang/analysis.lux
index 4e823276d..3cd63b65f 100644
--- a/new-luxc/source/luxc/lang/analysis.lux
+++ b/new-luxc/source/luxc/lang/analysis.lux
@@ -4,6 +4,7 @@
(.. ["lp" pattern]))
(type: #export #rec Analysis
+ #Unit
(#Bool Bool)
(#Nat Nat)
(#Int Int)
@@ -11,12 +12,11 @@
(#Real Real)
(#Char Char)
(#Text Text)
- #Unit
(#Sum (Either Analysis Analysis))
(#Product Analysis Analysis)
(#Case Analysis (List [lp;Pattern Analysis]))
(#Function Scope Analysis)
(#Apply Analysis Analysis)
- (#Procedure Ident (List Analysis))
+ (#Procedure Text (List Analysis))
(#Relative Ref)
(#Absolute Ident))
diff --git a/new-luxc/source/luxc/lang/synthesis.lux b/new-luxc/source/luxc/lang/synthesis.lux
index 1edf0f1a0..491891600 100644
--- a/new-luxc/source/luxc/lang/synthesis.lux
+++ b/new-luxc/source/luxc/lang/synthesis.lux
@@ -3,6 +3,7 @@
(.. ["lp" pattern]))
(type: #export #rec Synthesis
+ #Unit
(#Bool Bool)
(#Nat Nat)
(#Int Int)
@@ -10,11 +11,12 @@
(#Real Real)
(#Char Char)
(#Text Text)
- (#Variant Nat Nat Synthesis)
+ (#Variant Nat Bool Synthesis)
(#Tuple (List Synthesis))
(#Case (List [lp;Pattern Synthesis]))
- (#Function Scope Synthesis)
+ (#Function Nat Scope Synthesis)
(#Call Synthesis (List Synthesis))
- (#Procedure Ident (List Synthesis))
+ (#Recur Nat (List Synthesis))
+ (#Procedure Text (List Synthesis))
(#Relative Ref)
(#Absolute Ident))