Step 17b: bytecode-compiled text-layout, WASM library import fix
- text-layout.sx added to WASM bytecode pipeline (9K compiled) - Fix multi-list map calls (map-indexed + nth instead of map fn list1 list2) - pretext-layout-lines and pretext-position-line moved to library exports - Browser load-sxbc: handle VmSuspended for import, copy library exports to global_env after module load (define-library export fix) - compile-modules.js: text-layout in SOURCE_MAP, FILES, and entry deps - Island uses library functions (break-lines, pretext-layout-lines) instead of inlining — runs on bytecode VM when exports resolve Known issue: define-library exports don't propagate to browser global env yet. The load-sxbc import suspension handler resumes correctly but bind_import_set doesn't fire. Needs deeper investigation into how the WASM kernel's define-library registers exports vs how other libraries (adapter-html, tw) make their exports available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -727,30 +727,68 @@
|
||||
parse-remove-cmd
|
||||
(fn
|
||||
()
|
||||
(if
|
||||
(= (tp-type) "class")
|
||||
(let
|
||||
((cls (get (adv!) "value")) (extra-classes (list)))
|
||||
(define
|
||||
collect-classes!
|
||||
(fn
|
||||
()
|
||||
(when
|
||||
(= (tp-type) "class")
|
||||
(set!
|
||||
extra-classes
|
||||
(append extra-classes (list (get (adv!) "value"))))
|
||||
(collect-classes!))))
|
||||
(collect-classes!)
|
||||
(cond
|
||||
((= (tp-type) "class")
|
||||
(let
|
||||
((tgt (parse-tgt-kw "from" (list (quote me)))))
|
||||
((cls (get (adv!) "value")) (extra-classes (list)))
|
||||
(define
|
||||
collect-classes!
|
||||
(fn
|
||||
()
|
||||
(when
|
||||
(= (tp-type) "class")
|
||||
(set!
|
||||
extra-classes
|
||||
(append extra-classes (list (get (adv!) "value"))))
|
||||
(collect-classes!))))
|
||||
(collect-classes!)
|
||||
(let
|
||||
((tgt (if (match-kw "from") (parse-expr) nil)))
|
||||
(if
|
||||
(empty? extra-classes)
|
||||
(list (quote remove-class) cls tgt)
|
||||
(cons
|
||||
(quote multi-remove-class)
|
||||
(cons tgt (cons cls extra-classes)))))))
|
||||
((and (= (tp-type) "bracket-open") (= (tp-val) "["))
|
||||
(do
|
||||
(adv!)
|
||||
(if
|
||||
(empty? extra-classes)
|
||||
(list (quote remove-class) cls tgt)
|
||||
(cons
|
||||
(quote multi-remove-class)
|
||||
(cons tgt (cons cls extra-classes))))))
|
||||
nil)))
|
||||
(= (tp-type) "attr")
|
||||
(let
|
||||
((attr-name (get (adv!) "value")))
|
||||
(match-kw "]")
|
||||
(let
|
||||
((tgt (if (match-kw "from") (parse-expr) nil)))
|
||||
(list (quote remove-attr) attr-name tgt)))
|
||||
nil)))
|
||||
((= (tp-val) "{")
|
||||
(do
|
||||
(adv!)
|
||||
(let
|
||||
((props (list)))
|
||||
(define
|
||||
collect-props!
|
||||
(fn
|
||||
()
|
||||
(when
|
||||
(not (= (tp-val) "}"))
|
||||
(when (= (tp-val) ";") (adv!))
|
||||
(when
|
||||
(not (= (tp-val) "}"))
|
||||
(set!
|
||||
props
|
||||
(append props (list (get (adv!) "value"))))
|
||||
(collect-props!)))))
|
||||
(collect-props!)
|
||||
(match-kw "}")
|
||||
(let
|
||||
((tgt (if (match-kw "from") (parse-expr) nil)))
|
||||
(list (quote remove-css) props tgt)))))
|
||||
(true
|
||||
(let
|
||||
((target (parse-expr)))
|
||||
(list (quote remove-element) target))))))
|
||||
(define
|
||||
parse-toggle-cmd
|
||||
(fn
|
||||
@@ -1168,6 +1206,7 @@
|
||||
()
|
||||
(let
|
||||
((target (parse-expr)))
|
||||
(match-kw "then")
|
||||
(let
|
||||
((body (parse-cmd-list)))
|
||||
(match-kw "end")
|
||||
|
||||
Reference in New Issue
Block a user