fixed pipeline module loading; better parse errors for function literals in objects

This commit is contained in:
2026-02-16 18:41:35 -06:00
parent a1ee7dd458
commit 5a7169654a
2 changed files with 58 additions and 3 deletions

View File

@@ -437,7 +437,14 @@ var parse = function(tokens, src, filename, tokenizer) {
}
push(list, pair)
if (tok.kind == ",") advance()
else break
else if (tok.kind == "{") {
if (right && right.kind == "(") {
parse_error(tok, "unexpected '{' after property value; use method shorthand `name(args) { ... }` or `name: function(args) { ... }`")
} else {
parse_error(tok, "expected ',' or '}' in object literal")
}
break
} else break
}
ast_node_end(node)
if (tok.kind == "}") advance()