better compiler warnings adn errors
This commit is contained in:
7
parse.cm
7
parse.cm
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user