]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Better printing of token errors.
authorDale Weiler <killfieldengine@gmail.com>
Sat, 2 Feb 2013 01:03:39 +0000 (01:03 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 2 Feb 2013 01:03:39 +0000 (01:03 +0000)
lexer.c
parser.c

diff --git a/lexer.c b/lexer.c
index e1cff47ef24bfd19b2ff7c27a14d1b450f846724..620e4b44fb52b78ac38f9ed8930c1dad86631896 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -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);
 }
index 17badd74c390cb014dd14e58ded401268da0173e..90d73bae931ec3c9ceb4ea531c008edd8fc2c353 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -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;