diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | parser.l | 14 |
2 files changed, 23 insertions, 0 deletions
@@ -1,5 +1,14 @@ 2014-02-12 Kaz Kylheku <kaz@kylheku.com> + * parser.l: Disallow syntax like 1.0a, flagging it as + an invalid floating-point token. The problem is that 1a is allowed, + for compatibility with other Lisp dialects (it is a symbol) whereas + 1.0a was scanning as 1.0 followed by a, which is inconsistent. + Some Lisp dialects embedded dots in symbols, and allow 1.0a + as a symbol token. We don't. + +2014-02-12 Kaz Kylheku <kaz@kylheku.com> + * hash.c (struct hash): New member, equal_fun. (hash_equal_op): Short circuited logic: whenever we pull identical cells from either hash, we don't have to go @@ -213,6 +213,20 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return NUMBER; } +<SPECIAL>({FLO}|{FLODOT}){TOK} | +<BRACED>({FLO}|{FLODOT}){BTOK} | +<NESTED>({FLO}|{FLODOT}){NTOK} { + val str = string_utf8(yytext); + + yyerrorf(lit("trailing junk in floating-point literal: ~a"), str, nao); + + if (yy_top_state() == INITIAL + || yy_top_state() == QSILIT) + yy_pop_state(); + + yylval.val = flo_str(str); + return NUMBER; +} <SPECIAL,NESTED,BRACED>{FLO} { val str = string_own(utf8_dup_from(yytext)); |