From d95d714c02991fdf212f1ff56fab9c98746a8f73 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 6 May 2012 15:14:30 +0200 Subject: [PATCH] Report an error, if the exponent of a floating point constant has no digits. --- lexer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lexer.c b/lexer.c index 606cce4..2177a30 100644 --- a/lexer.c +++ b/lexer.c @@ -336,9 +336,13 @@ static void parse_exponent(void) next_char(); } - while (isdigit(c)) { - obstack_1grow(&symbol_obstack, (char)c); - next_char(); + if (isdigit(c)) { + do { + obstack_1grow(&symbol_obstack, (char)c); + next_char(); + } while (isdigit(c)); + } else { + errorf(&lexer_token.base.source_position, "exponent has no digits"); } } -- 2.20.1