aboutsummaryrefslogtreecommitdiff
path: root/new-luxc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/analyser.lux2
-rw-r--r--new-luxc/source/luxc/analyser/reference.lux4
-rw-r--r--new-luxc/source/luxc/lang/analysis.lux6
-rw-r--r--new-luxc/source/luxc/synthesizer.lux6
-rw-r--r--new-luxc/test/test/luxc/analyser/reference.lux8
-rw-r--r--new-luxc/test/test/luxc/synthesizer/case/special.lux2
-rw-r--r--new-luxc/test/test/luxc/synthesizer/function.lux4
-rw-r--r--new-luxc/test/test/luxc/synthesizer/loop.lux6
8 files changed, 19 insertions, 19 deletions
diff --git a/new-luxc/source/luxc/analyser.lux b/new-luxc/source/luxc/analyser.lux
index 799e2365d..6f9eda064 100644
--- a/new-luxc/source/luxc/analyser.lux
+++ b/new-luxc/source/luxc/analyser.lux
@@ -110,7 +110,7 @@
[[funcT =func] (&&common;with-unknown-type
(analyse func))]
(case =func
- (#la;Absolute def-name)
+ (#la;Definition def-name)
(do @
[[def-type def-anns def-value] (macro;find-def def-name)]
(if (macro;macro? def-anns)
diff --git a/new-luxc/source/luxc/analyser/reference.lux b/new-luxc/source/luxc/analyser/reference.lux
index ea0505c3b..5f09ee774 100644
--- a/new-luxc/source/luxc/analyser/reference.lux
+++ b/new-luxc/source/luxc/analyser/reference.lux
@@ -15,7 +15,7 @@
expected macro;expected-type
_ (&;within-type-env
(TC;check expected actual))]
- (wrap (#la;Absolute def-name))))
+ (wrap (#la;Definition def-name))))
(def: (analyse-variable var-name)
(-> Text (Lux (Maybe Analysis)))
@@ -27,7 +27,7 @@
[expected macro;expected-type
_ (&;within-type-env
(TC;check expected actual))]
- (wrap (#;Some (#la;Relative ref))))
+ (wrap (#;Some (#la;Variable ref))))
#;None
(wrap #;None))))
diff --git a/new-luxc/source/luxc/lang/analysis.lux b/new-luxc/source/luxc/lang/analysis.lux
index 308296086..9b7c000f3 100644
--- a/new-luxc/source/luxc/lang/analysis.lux
+++ b/new-luxc/source/luxc/lang/analysis.lux
@@ -28,8 +28,8 @@
(#Function Scope Analysis)
(#Apply Analysis Analysis)
(#Procedure Text (List Analysis))
- (#Relative Ref)
- (#Absolute Ident))
+ (#Variable Ref)
+ (#Definition Ident))
## Variants get analysed as binary sum types for the sake of semantic
## simplicity.
@@ -56,7 +56,7 @@
(case value
(#Sum _)
(#Case value (list [(#BindP temp)
- (#Relative (#;Local temp))]))
+ (#Variable (#;Local temp))]))
_
value)
diff --git a/new-luxc/source/luxc/synthesizer.lux b/new-luxc/source/luxc/synthesizer.lux
index 484864652..bd6220337 100644
--- a/new-luxc/source/luxc/synthesizer.lux
+++ b/new-luxc/source/luxc/synthesizer.lux
@@ -40,7 +40,7 @@
[#la;Deg #ls;Deg]
[#la;Real #ls;Real]
[#la;Text #ls;Text]
- [#la;Absolute #ls;Definition])
+ [#la;Definition #ls;Definition])
(#la;Product _)
(#ls;Tuple (L/map (recur +0 resolver num-locals) (&&structure;unfold-tuple exprA)))
@@ -49,7 +49,7 @@
(let [[tag last? value] (&&structure;unfold-variant choice)]
(#ls;Variant tag last? (recur +0 resolver num-locals value)))
- (#la;Relative ref)
+ (#la;Variable ref)
(case ref
(#;Local register)
(if (&&function;nested? outer-arity)
@@ -68,7 +68,7 @@
(let [inputS (recur +0 resolver num-locals inputA)]
(case (list;reverse branchesA)
(^multi (^ (list [(#la;BindP input-register)
- (#la;Relative (#;Local output-register))]))
+ (#la;Variable (#;Local output-register))]))
(n.= input-register output-register))
inputS
diff --git a/new-luxc/test/test/luxc/analyser/reference.lux b/new-luxc/test/test/luxc/analyser/reference.lux
index 33d93e415..9d22088b5 100644
--- a/new-luxc/test/test/luxc/analyser/reference.lux
+++ b/new-luxc/test/test/luxc/analyser/reference.lux
@@ -23,18 +23,18 @@
scope-name (r;text +5)
var-name (r;text +5)]
($_ seq
- (test "Can analyse relative reference."
+ (test "Can analyse variable."
(|> (&env;with-scope scope-name
(&env;with-local [var-name ref-type]
(@common;with-unknown-type
(@;analyse-reference ["" var-name]))))
(macro;run (init-compiler []))
- (case> (#R;Success [_type (#~;Relative idx)])
+ (case> (#R;Success [_type (#~;Variable idx)])
(Type/= ref-type _type)
_
false)))
- (test "Can analyse absolute reference."
+ (test "Can analyse definition."
(|> (do Monad<Lux>
[_ (&module;create +0 module-name)
_ (&module;define [module-name var-name]
@@ -42,7 +42,7 @@
(@common;with-unknown-type
(@;analyse-reference [module-name var-name])))
(macro;run (init-compiler []))
- (case> (#R;Success [_type (#~;Absolute idx)])
+ (case> (#R;Success [_type (#~;Definition idx)])
(Type/= ref-type _type)
_
diff --git a/new-luxc/test/test/luxc/synthesizer/case/special.lux b/new-luxc/test/test/luxc/synthesizer/case/special.lux
index fe5ad20ac..cf2ab9372 100644
--- a/new-luxc/test/test/luxc/synthesizer/case/special.lux
+++ b/new-luxc/test/test/luxc/synthesizer/case/special.lux
@@ -21,7 +21,7 @@
temp r;nat
#let [maskA (#la;Case maskedA
(list [(#la;BindP temp)
- (#la;Relative (#;Local temp))]))]]
+ (#la;Variable (#;Local temp))]))]]
(test "Dummy variables created to mask expressions get eliminated during synthesis."
(|> (synthesizer;synthesize maskA)
(corresponds? maskedA))))
diff --git a/new-luxc/test/test/luxc/synthesizer/function.lux b/new-luxc/test/test/luxc/synthesizer/function.lux
index acc39ce16..c9d3befee 100644
--- a/new-luxc/test/test/luxc/synthesizer/function.lux
+++ b/new-luxc/test/test/luxc/synthesizer/function.lux
@@ -85,7 +85,7 @@
[chosen (pick (list;size global-env))]
(wrap [num-args
(assume (D;get chosen resolver))
- (#la;Relative (#;Captured chosen))])))))))]
+ (#la;Variable (#;Captured chosen))])))))))]
(wrap [total-args prediction (#la;Function (make-scope absolute-env) bodyA)])
))
@@ -102,7 +102,7 @@
[chosen (|> r;nat (:: @ map (|>. (n.% +100) (n.max +2))))]
(wrap [num-args
(|> chosen (n.+ (n.dec num-args)) nat-to-int)
- (#la;Relative (#;Local chosen))])))))
+ (#la;Variable (#;Local chosen))])))))
(context: "Function definition."
[[args1 prediction1 function1] gen-function//constant
diff --git a/new-luxc/test/test/luxc/synthesizer/loop.lux b/new-luxc/test/test/luxc/synthesizer/loop.lux
index abc06dbb8..386f14cfa 100644
--- a/new-luxc/test/test/luxc/synthesizer/loop.lux
+++ b/new-luxc/test/test/luxc/synthesizer/loop.lux
@@ -103,13 +103,13 @@
[arity (|> r;nat (:: @ map (|>. (n.% +10) (n.max +1))))
recur? r;bool
outputS (if recur?
- (wrap (make-apply (#la;Relative (#;Local +0))
+ (wrap (make-apply (#la;Variable (#;Local +0))
(list;repeat arity #la;Unit)))
(do @
[plus-or-minus? r;bool
how-much (|> r;nat (:: @ map (|>. (n.% arity) (n.max +1))))
#let [shift (if plus-or-minus? n.+ n.-)]]
- (wrap (make-apply (#la;Relative (#;Local +0))
+ (wrap (make-apply (#la;Variable (#;Local +0))
(list;repeat (shift how-much arity) #la;Unit)))))
bodyS (gen-body arity outputS)]
(wrap [recur? arity (make-function arity bodyS)])))
@@ -120,7 +120,7 @@
[arity (|> r;nat (:: @ map (|>. (n.% +10) (n.max +1))))
recur? r;bool
self-ref? r;bool
- #let [selfA (#la;Relative (#;Local +0))
+ #let [selfA (#la;Variable (#;Local +0))
argA (if self-ref? selfA #la;Unit)]
outputS (if recur?
(wrap (make-apply selfA (list;repeat arity argA)))