fix labeled loops, do-while, shorthand property syntax, and added more tests

This commit is contained in:
2026-02-10 10:32:54 -06:00
parent bd577712d9
commit 4e5f1d8faa
5 changed files with 559 additions and 1 deletions

View File

@@ -426,7 +426,12 @@ var parse = function(tokens, src, filename, tokenizer) {
function_nr = function_nr + 1
ast_node_end(fn)
pair.right = fn
} else if (!(is_ident && (tok.kind == "," || tok.kind == "}"))) {
} else if (is_ident && (tok.kind == "," || tok.kind == "}")) {
right = ast_node("name", pair.left)
right.name = pair.left.name
ast_node_end(right)
pair.right = right
} else {
parse_error(tok, "expected ':' after property name")
}
push(list, pair)