release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
43
modules/owu/cli/run.owa
Normal file
43
modules/owu/cli/run.owa
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
(seq
|
||||
(def target (vec.find #(bool.not (str.starts-with? %1 "-")) (vec.reverse args)))
|
||||
(if (null? target) (seq
|
||||
(trace "No target specified")
|
||||
(return)
|
||||
))
|
||||
|
||||
(fn parse-arg [args name] (seq
|
||||
(def idx (vec.index-of args name))
|
||||
(if (null? idx)
|
||||
null
|
||||
(vec.get args (+ idx 1))
|
||||
)
|
||||
))
|
||||
|
||||
(def no-builtins? (vec.has args "--no-builtins"))
|
||||
(def no-core? (vec.has args "--no-core"))
|
||||
(def no-std? (vec.has args "--no-std"))
|
||||
(def is-debug? (vec.has args "--debug"))
|
||||
(def test-target (parse-arg args "--test"))
|
||||
|
||||
(exec
|
||||
{
|
||||
:__runtime__ :owu
|
||||
:__dir__ ""
|
||||
:__main__ target
|
||||
:__test__ test-target
|
||||
}
|
||||
(seq
|
||||
(unless no-builtins?
|
||||
(def builtins builtins))
|
||||
|
||||
(unless (bool.or no-builtins? no-core?)
|
||||
(include (str.concat modules-dir "/core")))
|
||||
|
||||
(unless (bool.or no-builtins? no-core? no-std?)
|
||||
(include (str.concat modules-dir "/std")))
|
||||
|
||||
(def __is_debug__ is-debug?)
|
||||
)
|
||||
target
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue