diff options
author | Eduardo Julian | 2017-05-09 17:48:27 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-09 17:48:27 -0400 |
commit | dd5220e13b03c8f85972feac535a34ef64525222 (patch) | |
tree | 2ac08a118eaa63f11c2397a08eaca74d199f2d1e /new-luxc/source/luxc/lang | |
parent | 7b74c1258f345d576b0c798303b0ed28f1734368 (diff) |
- Added tests for some kinds of analysis.
- WIP: Porting more code.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang.lux | 44 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/analysis.lux | 30 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/pattern.lux | 15 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/synthesis.lux | 21 |
4 files changed, 66 insertions, 44 deletions
diff --git a/new-luxc/source/luxc/lang.lux b/new-luxc/source/luxc/lang.lux deleted file mode 100644 index 787895466..000000000 --- a/new-luxc/source/luxc/lang.lux +++ /dev/null @@ -1,44 +0,0 @@ -(;module: - lux) - -(type: #export (Pattern a) Void) - -(type: #export Primitive - #Unit - (#Bool Bool) - (#Nat Nat) - (#Int Int) - (#Deg Deg) - (#Real Real) - (#Char Char) - (#Text Text)) - -(type: #export Reference - (#Relative Ref) - (#Absolute Ident)) - -(type: #export (Structure a) - (#Variant Nat Bool a) - (#Tuple (List a)) - (#Case (Pattern a)) - (#Function Scope a) - (#Call a (List a)) - (#Procedure Text (List a))) - -(type: #export (Analysis' Analysis) - (#Primitive Primitive) - (#Structure (Structure Analysis)) - (#Reference Reference)) - -(type: #export #rec Analysis - (Meta [Type Cursor] - (Analysis' Analysis))) - -(type: #export Synthesis - Unit) - -(type: #export Eval - (-> Type Code (Lux Top))) - -(type: #export Analyser - (-> Eval Code (Lux Analysis))) diff --git a/new-luxc/source/luxc/lang/analysis.lux b/new-luxc/source/luxc/lang/analysis.lux new file mode 100644 index 000000000..092b561f0 --- /dev/null +++ b/new-luxc/source/luxc/lang/analysis.lux @@ -0,0 +1,30 @@ +(;module: + lux + (lux (data [product])) + (.. ["lp" pattern])) + +(type: #export (Analysis' Analysis) + #Unit + (#Bool Bool) + (#Nat Nat) + (#Int Int) + (#Deg Deg) + (#Real Real) + (#Char Char) + (#Text Text) + (#Variant Nat Bool Analysis) + (#Tuple (List Analysis)) + (#Case (List [lp;Pattern Analysis])) + (#Function Scope Analysis) + (#Call Analysis (List Analysis)) + (#Procedure Text (List Analysis)) + (#Relative Ref) + (#Absolute Ident)) + +(type: #export #rec Analysis + (Meta [Type Cursor] + (Analysis' Analysis))) + +(def: #export (get-type analysis) + (-> Analysis Type) + (|> analysis product;left product;left)) diff --git a/new-luxc/source/luxc/lang/pattern.lux b/new-luxc/source/luxc/lang/pattern.lux new file mode 100644 index 000000000..a0077133b --- /dev/null +++ b/new-luxc/source/luxc/lang/pattern.lux @@ -0,0 +1,15 @@ +(;module: + lux) + +(type: #export #rec Pattern + (#Ref Nat) + #Unit + (#Bool Bool) + (#Nat Nat) + (#Int Int) + (#Deg Deg) + (#Real Real) + (#Char Char) + (#Text Text) + (#Tuple (List Pattern)) + (#Variant [Nat Nat] Pattern)) diff --git a/new-luxc/source/luxc/lang/synthesis.lux b/new-luxc/source/luxc/lang/synthesis.lux new file mode 100644 index 000000000..00cccfbe6 --- /dev/null +++ b/new-luxc/source/luxc/lang/synthesis.lux @@ -0,0 +1,21 @@ +(;module: + lux + (.. ["lp" pattern])) + +(type: #export #rec Synthesis + #Unit + (#Bool Bool) + (#Nat Nat) + (#Int Int) + (#Deg Deg) + (#Real Real) + (#Char Char) + (#Text Text) + (#Variant Nat Bool Synthesis) + (#Tuple (List Synthesis)) + (#Case (lp;Pattern Synthesis)) + (#Function Scope Synthesis) + (#Call Synthesis (List Synthesis)) + (#Procedure Text (List Synthesis)) + (#Relative Ref) + (#Absolute Ident)) |