aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/lang/compiler/init.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/lang/compiler/init.lux')
-rw-r--r--stdlib/source/lux/lang/compiler/init.lux51
1 files changed, 51 insertions, 0 deletions
diff --git a/stdlib/source/lux/lang/compiler/init.lux b/stdlib/source/lux/lang/compiler/init.lux
new file mode 100644
index 000000000..92a066b7e
--- /dev/null
+++ b/stdlib/source/lux/lang/compiler/init.lux
@@ -0,0 +1,51 @@
+(.module:
+ lux
+ [///]
+ [///host])
+
+(def: #export (cursor file)
+ (-> Text Cursor)
+ [file +1 +0])
+
+(def: #export (source file code)
+ (-> Text Text Source)
+ [(cursor file) +0 code])
+
+(def: dummy-source
+ Source
+ [.dummy-cursor +0 ""])
+
+(def: #export type-context
+ Type-Context
+ {#.ex-counter +0
+ #.var-counter +0
+ #.var-bindings (list)})
+
+(`` (def: #export info
+ Info
+ {#.target (for {(~~ (static ///host.common-lisp)) ///host.common-lisp
+ (~~ (static ///host.js)) ///host.js
+ (~~ (static ///host.jvm)) ///host.jvm
+ (~~ (static ///host.lua)) ///host.lua
+ (~~ (static ///host.php)) ///host.php
+ (~~ (static ///host.python)) ///host.python
+ (~~ (static ///host.r)) ///host.r
+ (~~ (static ///host.ruby)) ///host.ruby
+ (~~ (static ///host.scheme)) ///host.scheme})
+ #.version ///.version
+ #.mode #.Build}))
+
+(def: #export (compiler host)
+ (-> Any Lux)
+ {#.info ..info
+ #.source dummy-source
+ #.cursor .dummy-cursor
+ #.current-module #.None
+ #.modules (list)
+ #.scopes (list)
+ #.type-context ..type-context
+ #.expected #.None
+ #.seed +0
+ #.scope-type-vars (list)
+ #.extensions []
+ #.host host})