wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffe50ed02
commit
19fcf60599
459 changed files with 17862 additions and 17603 deletions
|
|
@ -2,25 +2,25 @@
|
|||
# that passed a class down to it, all at once: the rules that match, from all of them, ordered by
|
||||
# specificity as one sheet's are. On a tie the user's rule wins (the outermost user's last), as a
|
||||
# later rule does. Then `order`, which rearranges a flex box's children without touching the tree.
|
||||
function cs_merged(n: UiNode) -> void {
|
||||
function cs_merged(ui_st: mut UiState, n: UiNode) -> void {
|
||||
let rules = new []UiRule
|
||||
let envs = new []UiEnv
|
||||
let seen = new []UiSheet
|
||||
if n.sheet != null { cs_gather(n, n.sheet, n.env, rules, envs, seen) }
|
||||
if n.sheet != null { cs_gather(ui_st, n, n.sheet, n.env, rules, envs, seen) }
|
||||
for i in 0 .. len(n.ups) {
|
||||
if n.ups[i].sheet != null { cs_gather(n, n.ups[i].sheet, n.ups[i].env, rules, envs, seen) }
|
||||
if n.ups[i].sheet != null { cs_gather(ui_st, n, n.ups[i].sheet, n.ups[i].env, rules, envs, seen) }
|
||||
}
|
||||
for i in 0 .. len(rules) { cs_rule_in(n, rules[i], envs[i]) }
|
||||
for i in 0 .. len(rules) { cs_rule_in(ui_st, n, rules[i], envs[i]) }
|
||||
}
|
||||
# a sheet's matching rules into the list, each after every rule at most as specific (stable)
|
||||
function cs_gather(n: UiNode, sh: UiSheet, e: UiEnv, rules: []UiRule, envs: []UiEnv, seen: []UiSheet) -> void {
|
||||
function cs_gather(ui_st: mut UiState, n: UiNode, sh: UiSheet, e: UiEnv, rules: []UiRule, envs: []UiEnv, seen: []UiSheet) -> void {
|
||||
for i in 0 .. len(seen) {
|
||||
if seen[i] == sh { return }
|
||||
}
|
||||
push(seen, sh)
|
||||
for i in 0 .. len(sh.rules) {
|
||||
let r = sh.rules[i]
|
||||
if md_ok(r) and sel_match(r.sel, n) {
|
||||
if md_ok(ui_st, r) and sel_match(ui_st, r.sel, n) {
|
||||
push(rules, r)
|
||||
push(envs, e)
|
||||
var j = len(rules) - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue