application/octet-stream
•
6.14 KB
•
500 lines
#{
05v "Nujel Standalone"
0Es test-context
0D
25v help v [i] v "Describe 10 functions at offset 1" v #{
10s i
08i 1 v int?
0Bo 7
24
09o 16
10s i
08i 1 v int
0Fs i
0D
10s off
02i 10
08i 2 v symbol-table
10s string
08i 2 v map
25v anonymous v [l] v "" v #{
10s l
08i 1 v describe
0Es desc
0D
10s l
05v " "
10s desc
08i 3 v cat
08i 1 v println
01
}
08i 2 v for-each
0D
08i 0 v symbol-count
02i 10
08i 2 v /
0Es sc
0D
05v "Help page "
10s i
05v " of "
10s sc
08i 4 v cat
08i 1 v println
01
}
0Es help
0D
25v file/eval v [path environment] v "Evaluate a Nujel source file in the current context" v #{
10s environment
0Bo 7
24
09o 11
10s root-closure
0Fs environment
0D
23s do
10s path
08i 1 v file/read
08i 1 v read
14
0Es source
0D
10s source
10s environment
08i 2 v macroexpand/forms
01
}
0Es file/eval
0D
25v file/file? v [filename] v "" v #{
10s filename
08i 1 v file/stat
05v :regular-file?
08i 2 v ref
01
}
0Es file/file?
0D
25v file/dir? v [filename] v "" v #{
10s filename
08i 1 v file/stat
05v :directory?
08i 2 v ref
01
}
0Es file/dir?
0D
25v directory/read-relative v [path] v "" v #{
10s path
08i 1 v directory/read
25v anonymous v [a] v "" v #{
10s path
05v "/"
10s a
08i 3 v cat
01
}
08i 2 v map
01
}
0Es directory/read-relative
0D
25v directory/read-recursive v [path] v "" v #{
10s path
08i 1 v directory/read-relative
25v anonymous v [A] v "" v #{
10s A
08i 1 v file/dir?
0Bo 15
10s A
08i 1 v directory/read-recursive
09o 7
10s A
01
}
08i 2 v map
08i 1 v flatten
01
}
0Es directory/read-recursive
0D
25v popen/trim v [cmd] v "Run CMD using popen and return the trimmed stdout" v #{
10s cmd
08i 1 v popen
12
08i 1 v trim
01
}
0Es popen/trim
01
}#{
05v "nujel"
0Es repl/executable-name
0D
05v #f
0Es repl/parse-args/eval-next
0D
05v #t
0Es repl/parse-args/run-repl
0D
24
08i 1 v tree/new
0Es repl/options
0D
24
08i 1 v tree/new
0Es repl/option-map
0D
25v repl/exception-handler v [error] v "" v #{
10s error
08i 1 v display/error
01
}
0Es repl/exception-handler
0D
24
0Es repl/history
0D
25v repl/prompt v [] v "> " v #{
05v "> "
01
}
0Es repl/prompt
0D
25v repl/wasm v [line] v "Evaluate LINE in the wasm context" v #{
10s repl/exception-handler
19o 27
10s root-closure
10s do
10s line
08i 1 v read
14
08i 2 v eval-in
16
01
}
0Es repl/wasm
0D
25v repl/readline v [ctx] v "" v #{
08i 0 v repl/prompt
08i 1 v readline
0Es line
0D
10s line
08i 1 v nil?
0Bo 23
05v "Bye!\r\n"
08i 1 v display
0D
02i 0
08i 1 v exit
09o 4
24
0D
10s ctx
10s do
10s line
08i 1 v read
14
08i 2 v eval-in
0Es result
0D
10s line
10s repl/history
14
0Fs repl/history
0D
10s result
08i 1 v nil?
0Bo 10
05v ""
09o 12
10s result
08i 1 v str/write
08i 1 v cat
08i 1 v println
01
}
0Es repl/readline
0D
25v repl v [] v "" v #{
02i 0
1B
1C
05v #t
0Bo 24
0D
10s repl/exception-handler
19o 13
10s root-closure
08i 1 v repl/readline
16
09o -26
01
}
0Es repl
0D
25v repl/print-help v [] v "" v #{
05v "Nujel"
08i 1 v ansi-rainbow
05v " - A Lisp dialect for games.\n"
08i 2 v cat
08i 1 v println
0D
05v "Usage:"
08i 1 v ansi-green
05v " nujel [options] [command_string | file]"
08i 2 v cat
08i 1 v println
0D
05v "\nLow-level options - for work on the runtime itself"
08i 1 v cat
08i 1 v println
0D
05v " "
05v "v"
08i 1 v ansi-yellow
05v " - be verbose"
08i 3 v cat
08i 1 v println
0D
05v "\nHigh-level options - for working with/on Nujel code"
08i 1 v cat
08i 1 v println
0D
05v " "
05v "x"
08i 1 v ansi-blue
05v " - Run the expression following this argument directly"
08i 3 v cat
08i 1 v println
0D
05v " "
05v "h"
08i 1 v ansi-blue
05v " - Print this help screen"
08i 3 v cat
08i 1 v println
0D
05v "\nLong options - for working with/on Nujel code"
08i 1 v cat
08i 1 v println
0D
05v " "
05v "no-color"
08i 1 v ansi-blue
05v " - Disable ANSI color"
08i 3 v cat
08i 1 v println
0D
05v " "
05v "color "
08i 1 v ansi-blue
05v " - Enable ANSI color"
08i 3 v cat
08i 1 v println
01
}
0Es repl/print-help
0D
10s repl/option-map
23s h
25v anonymous v [option] v "" v #{
08i 0 v repl/print-help
0D
05v #f
0Fs repl/parse-args/run-repl
01
}
08i 3 v tree/set!
0D
10s repl/option-map
23s no-color
25v anonymous v [option] v "" v #{
05v ""
0Fs ansi/disabled
01
}
08i 3 v tree/set!
0D
10s repl/option-map
23s color
25v anonymous v [option] v "" v #{
05v #f
0Fs ansi/disabled
01
}
08i 3 v tree/set!
0D
10s repl/option-map
23s x
25v anonymous v [option] v "" v #{
05v #t
0Fs repl/parse-args/eval-next
0D
05v #f
0Fs repl/parse-args/run-repl
01
}
08i 3 v tree/set!
0D
10s repl/option-map
05v :default
25v anonymous v [option] v "" v #{
10s repl/options
10s option
05v #t
08i 3 v tree/set!
01
}
08i 3 v tree/set!
0D
25v repl/parse-option v [option] v "" v #{
10s repl/option-map
10s option
08i 2 v ref
0C
0Ao 26
0D
10s repl/option-map
05v :default
08i 2 v ref
0C
0Ao 8
0D
05v #f
10s option
1Ai 1
01
}
0Es repl/parse-option
0D
25v repl/parse-options v [options] v "" v #{
10s options
02i 0
08i 2 v char-at
02i 45
20
0Bo 27
10s options
02i 1
08i 2 v cut
08i 1 v string->keyword
08i 1 v repl/parse-option
09o 34
10s options
05v ""
08i 2 v split
10s str->sym
08i 2 v map
10s repl/parse-option
08i 2 v for-each
01
}
0Es repl/parse-options
0D
25v repl/parse-arg v [arg] v "" v #{
10s repl/parse-args/eval-next
0Bo 46
10s display/error
19o 36
10s root-closure
10s do
10s arg
08i 1 v read
14
08i 2 v eval-in
0D
05v #f
0Fs repl/parse-args/eval-next
16
09o 76
10s arg
02i 0
08i 2 v char-at
02i 45
20
0Bo 22
10s arg
02i 1
08i 2 v string/cut
08i 1 v repl/parse-options
09o 40
05v #t
0Bo 32
10s display/error
19o 13
10s arg
08i 1 v file/eval
16
0D
05v #f
0Fs repl/parse-args/run-repl
09o 4
24
01
}
0Es repl/parse-arg
0D
25v repl/parse-args v [args] v "" v #{
10s args
0Bo 27
10s args
11
08i 1 v repl/parse-arg
0D
10s args
12
08i 1 v repl/parse-args
09o 7
10s repl/parse-args/run-repl
01
}
0Es repl/parse-args
0D
25v repl/init/wasm v [args] v "" v #{
05v "Nujel"
08i 1 v ansi-rainbow
05v " heißt euch willkommen!"
08i 2 v cat
08i 1 v println
01
}
0Es repl/init/wasm
0D
25v repl/init/bin v [args] v "" v #{
10s repl/exception-handler
19o 36
10s args
11
0Fs repl/executable-name
0D
10s args
12
08i 1 v repl/parse-args
0Bo 11
08i 0 v repl
09o 4
24
16
01
}
0Es repl/init/bin
0D
25v repl/init v args v "" v #{
10s System/Architecture
23s wasm
20
0Bo 15
10s args
08i 1 v repl/init/wasm
09o 12
10s args
08i 1 v repl/init/bin
01
}
0Es repl/init
01
}