diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-07 07:07:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-07 07:07:35 -0700 |
commit | 8b154a579becffc5c973797ff7ac7b162fd86b30 (patch) | |
tree | 3b92af1056e456c62d7627b28b975c6d71209475 /parser.l | |
parent | 5724fbcb5afd122b2f846b7f04e853254e729c7c (diff) | |
download | txr-8b154a579becffc5c973797ff7ac7b162fd86b30.tar.gz txr-8b154a579becffc5c973797ff7ac7b162fd86b30.tar.bz2 txr-8b154a579becffc5c973797ff7ac7b162fd86b30.zip |
Better diagnostic for cramped floating literals.
* parser.l: Different text needed for ).1 and a.1 cases,
because the insertion of a zero cannot fix the latter.
Might as well make the messages more detailed.
Diffstat (limited to 'parser.l')
-rw-r--r-- | parser.l | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -368,8 +368,11 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} <SPECIAL,QSPECIAL>{TOK}/{DOTFLO} | <BRACED>{BTOK}/{DOTFLO} | <NESTED>{NTOK}/{DOTFLO} { + printf("yytext: %s\n", yytext); yyerrorf(yyg, lit("cramped floating-point literal: " - "add 0 or whitespace"), nao); + "space needed between ~a and dot."), + string_own(utf8_dup_from(yytext)), + nao); if (yy_top_state(yyscanner) == INITIAL || yy_top_state(yyscanner) == QSILIT @@ -612,7 +615,9 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} <SPECIAL,QSPECIAL,NESTED>[)\]]/{DOTFLO} { yyerrorf(yyg, lit("cramped floating-point literal: " - "add 0 or whitespace"), nao); + "space or 0 needed between ~a and dot."), + string_own(utf8_dup_from(yytext)), + nao); yy_pop_state(yyscanner); if (yy_top_state(yyscanner) == INITIAL |