Compare commits
3 Commits
0cbae4ce61
...
9584a21521
Author | SHA1 | Date | |
---|---|---|---|
|
9584a21521 | ||
|
c61981fa16 | ||
|
0583af819f |
Binary file not shown.
|
@ -6489,7 +6489,7 @@ var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports['
|
|||
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
|
||||
var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type', 1);
|
||||
var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji', 5);
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1804032;
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1803120;
|
||||
function invoke_i(index) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
|
BIN
build/out.wasm
BIN
build/out.wasm
Binary file not shown.
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"license": "GPL-3.0",
|
||||
"devDependencies": {
|
||||
"shadow-cljs": "^2.26.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"description": "A Ludus interpreter in a pure JS function.",
|
||||
"type": "module",
|
||||
"main": "build/ludus.mjs",
|
||||
|
|
|
@ -49,10 +49,10 @@
|
|||
(set (out :draw) (post :draw))
|
||||
(-> out j/encode string))
|
||||
|
||||
(comment
|
||||
# (do
|
||||
# (comment
|
||||
(do
|
||||
(def source `
|
||||
words ("foo bar")
|
||||
"foo \bbar"
|
||||
`)
|
||||
(def out (-> source
|
||||
ludus
|
||||
|
|
|
@ -194,6 +194,15 @@
|
|||
:else (add-error scanner (string "Unexpected " curr " after number " num ".")))))
|
||||
(recur scanner (buffer char) false))
|
||||
|
||||
(def escape {
|
||||
"\"" "\""
|
||||
"n" "\n"
|
||||
"{" "{"
|
||||
"t" "\t"
|
||||
"r" "\r"
|
||||
"\\" "\\"
|
||||
})
|
||||
|
||||
(defn- add-string
|
||||
[scanner]
|
||||
(defn recur [scanner buff interpolate?]
|
||||
|
@ -204,12 +213,10 @@
|
|||
"\n" (recur (update (advance scanner) :line inc) (buffer/push buff char) interpolate?)
|
||||
"\"" (add-token (advance scanner) (if interpolate? :interpolated :string) (string buff))
|
||||
"\\" (let [next (next-char scanner)]
|
||||
(if (= next "{")
|
||||
(do
|
||||
(buffer/push buff char)
|
||||
(buffer/push buff next)
|
||||
(recur (advance (advance scanner)) buff interpolate?))
|
||||
(recur (advance scanner) (buffer/push buff char) interpolate?)))
|
||||
(recur
|
||||
(advance (advance scanner))
|
||||
(buffer/push buff (get escape next next))
|
||||
interpolate?))
|
||||
(if (at-end? scanner)
|
||||
(add-error scanner "Unterminated string.")
|
||||
(recur (advance scanner) (buffer/push buff char) interpolate?)))))
|
||||
|
@ -341,8 +348,8 @@
|
|||
(recur (-> scanner (scan-token) (next-token)))))
|
||||
(recur (new-scanner source input)))
|
||||
|
||||
# (comment
|
||||
(do
|
||||
(comment
|
||||
# (do
|
||||
(def source "/iii")
|
||||
(scan source)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user