aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis
diff options
context:
space:
mode:
authorEduardo Julian2018-05-16 01:06:28 -0400
committerEduardo Julian2018-05-16 01:06:28 -0400
commit273c2d517dbafbe6df4d9b9ac65ffd4749e63642 (patch)
tree03cd1d8db4fa575f557bea6d82167399c6e04752 /new-luxc/source/luxc/lang/analysis
parent8ba6ac8952e3457b1a09e30ac5312168d48006d1 (diff)
- Migrated reference analysis to stdlib.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis')
-rw-r--r--new-luxc/source/luxc/lang/analysis/reference.lux57
1 files changed, 0 insertions, 57 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/reference.lux b/new-luxc/source/luxc/lang/analysis/reference.lux
deleted file mode 100644
index 56aba35de..000000000
--- a/new-luxc/source/luxc/lang/analysis/reference.lux
+++ /dev/null
@@ -1,57 +0,0 @@
-(.module:
- lux
- (lux (control monad)
- [macro]
- (macro [code])
- (lang (type ["tc" check])))
- (luxc ["&" lang]
- (lang ["&." scope]
- ["la" analysis #+ Analysis]
- [".L" variable #+ Variable])))
-
-## [Analysers]
-(def: (analyse-definition def-name)
- (-> Ident (Meta Analysis))
- (do macro.Monad<Meta>
- [[actualT def-anns _] (&.with-error-tracking
- (macro.find-def def-name))]
- (case (macro.get-symbol-ann (ident-for #.alias) def-anns)
- (#.Some real-def-name)
- (analyse-definition real-def-name)
-
- _
- (do @
- [_ (&.infer actualT)
- def-name (macro.normalize def-name)]
- (wrap (code.symbol def-name))))))
-
-(def: (analyse-variable var-name)
- (-> Text (Meta (Maybe Analysis)))
- (do macro.Monad<Meta>
- [?var (&scope.find var-name)]
- (case ?var
- (#.Some [actualT ref])
- (do @
- [_ (&.infer actualT)]
- (wrap (#.Some (` ((~ (code.int (variableL.from-ref ref))))))))
-
- #.None
- (wrap #.None))))
-
-(def: #export (analyse-reference reference)
- (-> Ident (Meta Analysis))
- (case reference
- ["" simple-name]
- (do macro.Monad<Meta>
- [?var (analyse-variable simple-name)]
- (case ?var
- (#.Some varA)
- (wrap varA)
-
- #.None
- (do @
- [this-module macro.current-module-name]
- (analyse-definition [this-module simple-name]))))
-
- _
- (analyse-definition reference)))