aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/lux.lux36
-rw-r--r--source/lux/meta/lux.lux9
2 files changed, 30 insertions, 15 deletions
diff --git a/source/lux.lux b/source/lux.lux
index ced208d40..36a0997f4 100644
--- a/source/lux.lux
+++ b/source/lux.lux
@@ -270,7 +270,8 @@
## #host HostState
## #seed Int
## #eval? Bool
-## #expected Type))
+## #expected Type
+## #cursor Cursor))
(_lux_def Compiler
(#AppT [(#AllT [(#Some #Nil) "lux;Compiler" ""
(#RecordT (#Cons [["lux;source" Reader]
@@ -284,7 +285,8 @@
(#Cons [["lux;seed" Int]
(#Cons [["lux;eval?" Bool]
(#Cons [["lux;expected" Type]
- #Nil])])])])])])])]))])
+ (#Cons [["lux;cursor" Cursor]
+ #Nil])])])])])])])])]))])
Void]))
(_lux_export Compiler)
@@ -1316,7 +1318,8 @@
(_lux_case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(_lux_case (reverse envs)
#Nil
(#Left "Can't get the module name without a module!")
@@ -1355,7 +1358,8 @@
(_lux_case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(#Right [state (find-macro' modules current-module module name)]))))))
(def''' (list:join xs)
@@ -1912,10 +1916,12 @@
(case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(#Right {#source source #modules modules
#envs envs #types types #host host
- #seed (i+ 1 seed) #eval? eval? #expected expected}
+ #seed (i+ 1 seed) #eval? eval? #expected expected
+ #cursor cursor}
(symbol$ ["__gensym__" (->text seed)]))))
(defmacro #export (sig tokens)
@@ -2187,7 +2193,8 @@
(lambda [state]
(let [{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected} state]
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor} state]
(#Right state expected))))
(defmacro #export (struct tokens)
@@ -2403,7 +2410,8 @@
(case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(case (get module modules)
(#Some =module)
(#Right state true)
@@ -2417,7 +2425,8 @@
(case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(case (get module modules)
(#Some =module)
(let [to-alias (map (: (-> (, Text (, Bool (DefData' (-> (List AST) (StateE Compiler (List AST))))))
@@ -2600,7 +2609,8 @@
(case state
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected}
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor}
(some (: (-> (Env Text (, LuxVar Type)) (Maybe Type))
(lambda [env]
(case env
@@ -2634,7 +2644,8 @@
(let [[v-prefix v-name] name
{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected} state]
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor} state]
(case (get v-prefix modules)
#None
#None
@@ -2686,7 +2697,8 @@
_
(let [{#source source #modules modules
#envs envs #types types #host host
- #seed seed #eval? eval? #expected expected} state]
+ #seed seed #eval? eval? #expected expected
+ #cursor cursor} state]
(#Left ($ text:++ "Unknown var: " (ident->text name) "\n\n" (show-envs envs)))))))))
(def (use-field field-name type)
diff --git a/source/lux/meta/lux.lux b/source/lux/meta/lux.lux
index 26513ed81..4d6c15bde 100644
--- a/source/lux/meta/lux.lux
+++ b/source/lux/meta/lux.lux
@@ -255,7 +255,8 @@
(case state
{#;source source #;modules modules
#;envs envs #;types types #;host host
- #;seed seed #;eval? eval? #;expected expected}
+ #;seed seed #;eval? eval? #;expected expected
+ #;cursor cursor}
(some (: (-> (Env Text (, LuxVar Type)) (Maybe Type))
(lambda [env]
(case env
@@ -275,7 +276,8 @@
(let [[v-prefix v-name] name
{#;source source #;modules modules
#;envs envs #;types types #;host host
- #;seed seed #;eval? eval? #;expected expected} state]
+ #;seed seed #;eval? eval? #;expected expected
+ #;cursor cursor} state]
(case (get v-prefix modules)
#;None
#;None
@@ -310,6 +312,7 @@
_
(let [{#;source source #;modules modules
#;envs envs #;types types #;host host
- #;seed seed #;eval? eval? #;expected expected} state]
+ #;seed seed #;eval? eval? #;expected expected
+ #;cursor cursor} state]
(#;Left ($ text:++ "Unknown var: " (ident->text name) "\n\n" (show-envs envs))))))))
))