aboutsummaryrefslogtreecommitdiff
path: root/tccpp.c
diff options
context:
space:
mode:
authorEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2016-05-04 20:27:39 +0100
committerEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2016-05-04 20:27:39 +0100
commita3485135691940c5e28b45f1c1bfd1ce7d5a815e (patch)
tree2962b514b8174f5af203dfcb9c0c8948d6babbfb /tccpp.c
parent60158405836a8c8f0f5e0644361fa694e94f2b2c (diff)
downloadtinycc-a3485135691940c5e28b45f1c1bfd1ce7d5a815e.tar.gz
tinycc-a3485135691940c5e28b45f1c1bfd1ce7d5a815e.tar.bz2
Revert 78e4ee5.
Diffstat (limited to 'tccpp.c')
-rw-r--r--tccpp.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/tccpp.c b/tccpp.c
index 7a74232..94f0b5f 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2557,7 +2557,6 @@ static inline void next_nomacro1(void)
TokenSym *ts;
uint8_t *p, *p1;
unsigned int h;
- int is_dec;
p = file->buf_ptr;
redo_no_start:
@@ -2752,45 +2751,23 @@ maybe_newline:
}
break;
- case '0':
- t = c;
- cstr_reset(&tokcstr);
- cstr_ccat(&tokcstr, c);
- PEEKC(c, p);
- is_dec = 1;
- if ((c == 'x') || (c == 'o') || (c == 'b'))
- is_dec = 0;
- goto parse_num;
-
- case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
- is_dec = 1;
- t = c;
cstr_reset(&tokcstr);
- cstr_ccat(&tokcstr, c);
- PEEKC(c, p);
+ /* after the first digit, accept digits, alpha, '.' or sign if
+ prefixed by 'eEpP' */
parse_num:
for(;;) {
- if (parse_flags & PARSE_FLAG_ASM_FILE) {
- if (!((isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
- || (c == '.')
- || ((c == '+' || c == '-')
- && (((t == 'e' || t == 'E') && is_dec) ||
- ((t == 'p' || t == 'P') && !is_dec)))
- ))
- break;
- } else
- if (!((isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
- || c == '.'
- || ((c == '+' || c == '-')
- && (t == 'e' || t == 'E' || t == 'p' || t == 'P')
- )))
- break;
-
t = c;
cstr_ccat(&tokcstr, c);
PEEKC(c, p);
+ if (!((isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
+ || c == '.'
+ || ((c == '+' || c == '-')
+ && (t == 'e' || t == 'E' || t == 'p' || t == 'P')
+ )))
+ break;
}
/* We add a trailing '\0' to ease parsing */
cstr_ccat(&tokcstr, '\0');
@@ -2804,8 +2781,6 @@ maybe_newline:
/* special dot handling because it can also start a number */
PEEKC(c, p);
if (isnum(c)) {
- t = '.';
- is_dec = 1;
cstr_reset(&tokcstr);
cstr_ccat(&tokcstr, '.');
goto parse_num;