better compiler warnings adn errors

This commit is contained in:
2026-02-20 12:40:49 -06:00
parent 54e5be0773
commit 8d449e6fc6
10 changed files with 679 additions and 93 deletions

View File

@@ -1727,6 +1727,13 @@ var parse = function(tokens, src, filename, tokenizer) {
return null
}
if (kind == "this") {
if (scope.function_nr == 0) {
sem_error(expr, "'this' cannot be used at the top level of a program")
}
return null
}
if (kind == "[") {
sem_check_expr(scope, expr.left)
sem_check_expr(scope, expr.right)