mirror of
https://github.com/janet-lang/janet
synced 2025-10-25 12:47:42 +00:00
Fix init.dst, work on metabuild tool to make
native module creation easier
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
# Flag handlers
|
||||
(def handlers :private
|
||||
{"h" (fn []
|
||||
{"h" (fn @[]
|
||||
(print "usage: " (get args 0) " [options] scripts...")
|
||||
(print
|
||||
`Options are:
|
||||
@@ -23,17 +23,17 @@
|
||||
-- Stop handling options`)
|
||||
(os.exit 0)
|
||||
1)
|
||||
"v" (fn [] (print VERSION) (os.exit 0) 1)
|
||||
"s" (fn [] (:= *raw-stdin* true) (:= *should-repl* true) 1)
|
||||
"r" (fn [] (:= *should-repl* true) 1)
|
||||
"p" (fn [] (:= *exit-on-error* false) 1)
|
||||
"-" (fn [] (:= *handleopts* false) 1)
|
||||
"e" (fn [i]
|
||||
"v" (fn @[] (print VERSION) (os.exit 0) 1)
|
||||
"s" (fn @[] (:= *raw-stdin* true) (:= *should-repl* true) 1)
|
||||
"r" (fn @[] (:= *should-repl* true) 1)
|
||||
"p" (fn @[] (:= *exit-on-error* false) 1)
|
||||
"-" (fn @[] (:= *handleopts* false) 1)
|
||||
"e" (fn @[i]
|
||||
(:= *no-file* false)
|
||||
(eval (get args (+ i 1)))
|
||||
2)})
|
||||
|
||||
(defn- dohandler [n i]
|
||||
(defn- dohandler @[n i]
|
||||
(def h (get handlers n))
|
||||
(if h (h i) (print "unknown flag -" n)))
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
(repl nil identity)
|
||||
(do
|
||||
(print (string "Dst " VERSION " Copyright (C) 2017-2018 Calvin Rose"))
|
||||
(repl (fn [buf p]
|
||||
(repl (fn @[buf p]
|
||||
(def [line] (parser.where p))
|
||||
(def prompt (string "dst:" line ":" (parser.state p) "> "))
|
||||
(getline prompt buf)))))))
|
||||
|
||||
Reference in New Issue
Block a user