Better printing of token errors.

This commit is contained in:
Dale Weiler 2013-02-02 01:03:39 +00:00
parent 4c0a836ca6
commit 319783e873
2 changed files with 2 additions and 2 deletions

View file

@ -1485,6 +1485,6 @@ int lex_do(lex_file *lex)
return (lex->tok.ttype = ch);
}
lexerror(lex, "unknown token: %c", lex->tok);
lexerror(lex, "unknown token: `%d`", lex->tok.value);
return (lex->tok.ttype = TOKEN_ERROR);
}

View file

@ -5554,7 +5554,7 @@ static bool parser_global_statement(parser_t *parser)
}
else
{
parseerror(parser, "unexpected token: %s", parser->lex->tok.value);
parseerror(parser, "unexpected token: `%s`", parser->lex->tok.value);
return false;
}
return true;