release 0.1.0

This commit is contained in:
rus07tam 2026-05-06 12:21:06 +03:00
commit 30d94536a9
90 changed files with 7722 additions and 0 deletions

19
modules/owu/cli/main.owa Normal file
View file

@ -0,0 +1,19 @@
(seq
(def cmd (vec.first argv))
(def args (vec.tail argv))
(if (bool.or (null? cmd) (str.starts-with? cmd "-")) (seq
(trace "Error: No command specified")
(return 1)
))
(try
(match cmd
("run" (include "run"))
(_ (trace "Error: Command '" cmd "' not found"))
)
(lambda [msg type] (seq
(trace type ": " msg)
(return 1)))
)
)

43
modules/owu/cli/run.owa Normal file
View 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
)
)