more logical algorithm of the isidnum_table[] changing
Unified · Split
| @@ -1330,6 +1330,7 @@ ST_FUNC void parse_define(void) · 1329 unmodified lines | ||
| 1330 | 1330 | if (tok == '(') { |
| 1331 | 1331 | /* must be able to parse TOK_DOTS (in asm mode '.' can be part of identifier) */ |
| 1332 | 1332 | parse_flags &= ~PARSE_FLAG_ASM_FILE; |
| 1333 | + isidnum_table['.' - CH_EOF] = 0; | |
| 1333 | 1334 | next_nomacro(); |
| 1334 | 1335 | ps = &first; |
| 1335 | 1336 | if (tok != ')') for (;;) { |
| @@ -1358,6 +1359,8 @@ ST_FUNC void parse_define(void) · 22 unmodified lines | ||
| 1358 | 1359 | next_nomacro_spc(); |
| 1359 | 1360 | t = MACRO_FUNC; |
| 1360 | 1361 | parse_flags |= (saved_parse_flags & PARSE_FLAG_ASM_FILE); |
| 1362 | + isidnum_table['.' - CH_EOF] = | |
| 1363 | + (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; | |
| 1361 | 1364 | } |
| 1362 | 1365 | tok_str_new(&str); |
| 1363 | 1366 | spc = 2; |
| @@ -2476,8 +2479,6 @@ maybe_newline: · 1112 unmodified lines | ||
| 2476 | 2479 | p1 = p; |
| 2477 | 2480 | h = TOK_HASH_INIT; |
| 2478 | 2481 | h = TOK_HASH_FUNC(h, c); |
| 2479 | − isidnum_table['.' - CH_EOF] = | |
| 2480 | − (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; | |
| 2481 | 2482 | while (c = *++p, isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM)) |
| 2482 | 2483 | h = TOK_HASH_FUNC(h, c); |
| 2483 | 2484 | if (c != '\\') { |
| @@ -2532,8 +2533,6 @@ maybe_newline: · 48 unmodified lines | ||
| 2532 | 2533 | } else { |
| 2533 | 2534 | cstr_reset(&tokcstr); |
| 2534 | 2535 | cstr_ccat(&tokcstr, 'L'); |
| 2535 | − isidnum_table['.' - CH_EOF] = | |
| 2536 | − (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; | |
| 2537 | 2536 | goto parse_ident_slow; |
| 2538 | 2537 | } |
| 2539 | 2538 | } |
| @@ -3369,6 +3368,9 @@ ST_FUNC void preprocess_init(TCCState *s1) · 829 unmodified lines | ||
| 3369 | 3368 | |
| 3370 | 3369 | isidnum_table['$' - CH_EOF] = |
| 3371 | 3370 | tcc_state->dollars_in_identifiers ? IS_ID : 0; |
| 3371 | + | |
| 3372 | + isidnum_table['.' - CH_EOF] = | |
| 3373 | + (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; | |
| 3372 | 3374 | } |
| 3373 | 3375 | |
| 3374 | 3376 | ST_FUNC void preprocess_new(void) |