- Added Semicolon token to lexer - Enables: click: items.push(x); input = "" - Push-and-clear, increment-and-reset, clear-all patterns - Browser-verified: both actions fire in one click - All existing examples pass regression
28 lines
787 B
Text
28 lines
787 B
Text
-- Multi-Action Click Handler Test
|
||
-- Tests semicolon-separated actions in click handlers
|
||
|
||
let items = ["Buy milk", "Walk dog"]
|
||
let input = ""
|
||
let count = 0
|
||
|
||
view main = column [
|
||
text "Multi-Action Demo" { variant: "title" }
|
||
text "Add items AND clear input in one click" { variant: "subtitle" }
|
||
|
||
row [
|
||
input { bind: input, placeholder: "New item..." }
|
||
button "Add & Clear" { click: items.push(input); input = "", variant: "primary" }
|
||
]
|
||
|
||
each item in items ->
|
||
row [
|
||
text "• {item}"
|
||
button "×" { click: items.remove(_idx), variant: "ghost" }
|
||
]
|
||
|
||
text "Count: {count}"
|
||
row [
|
||
button "+5 & Reset Name" { click: count += 5; input = "reset!", variant: "secondary" }
|
||
button "Reset All" { click: count = 0; items = [], variant: "ghost" }
|
||
]
|
||
]
|