From a38d8cad117770db020c470adc3397da072aab6d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 20 Aug 2019 16:59:34 -0700 Subject: lexer: no leading 0 in 2-digit hex chars in diagnostic. * parser.l (grammar): Fix incorrect format strings that are supposed to show an invalid input character in hex. For instance the character 1 comes out as #\x 1 rather than #\x01. --- parser.l | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.l b/parser.l index c0114b24..60e06727 100644 --- a/parser.l +++ b/parser.l @@ -833,13 +833,13 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} {UANYN} { val ch = chr_str(string_utf8(yytext), zero); if (chr_isspace(ch)) - yyerrprepf(yyg, lit("unexpected whitespace character #\\x~02x"), + yyerrprepf(yyg, lit("unexpected whitespace character #\\x~,02x"), ch, nao); else if (chr_isunisp(ch)) - yyerrprepf(yyg, lit("unexpected Unicode space character #\\x~02x"), + yyerrprepf(yyg, lit("unexpected Unicode space character #\\x~,02x"), ch, nao); else if (chr_iscntrl(ch)) - yyerrprepf(yyg, lit("unexpected control character #\\x~02x"), + yyerrprepf(yyg, lit("unexpected control character #\\x~,02x"), ch, nao); else yyerrprepf(yyg, lit("unexpected character #\\~a"), -- cgit v1.2.3