Better error message on too many inherited fields.

This commit is contained in:
Bob Nystrom
2014-04-22 07:06:26 -07:00
parent f1c3bb0f37
commit 80a4eb8c9c
8 changed files with 37 additions and 23 deletions
+6
View File
@@ -943,6 +943,12 @@ static int declareVariable(Compiler* compiler)
{
Token* token = &compiler->parser->previous;
if (token->length > MAX_VARIABLE_NAME)
{
error(compiler, "Variable name cannot be longer than %d characters.",
MAX_VARIABLE_NAME);
}
// Top-level global scope.
if (compiler->scopeDepth == -1)
{