History

cleaning "Identifiers can start and/or contain"

more logical algorithm of the isidnum_table[] changing

seyko committed 10 years ago

Commit effc7d91 parent 983c40f1 file · +6 −4Browse files

Unified · Split

tccpp.c+6−4
@@ -1330,6 +1330,7 @@ ST_FUNC void parse_define(void) · 1329 unmodified lines
13301330 if (tok == '(') {
13311331 /* must be able to parse TOK_DOTS (in asm mode '.' can be part of identifier) */
13321332 parse_flags &= ~PARSE_FLAG_ASM_FILE;
1333+ isidnum_table['.' - CH_EOF] = 0;
13331334 next_nomacro();
13341335 ps = &first;
13351336 if (tok != ')') for (;;) {
@@ -1358,6 +1359,8 @@ ST_FUNC void parse_define(void) · 22 unmodified lines
13581359 next_nomacro_spc();
13591360 t = MACRO_FUNC;
13601361 parse_flags |= (saved_parse_flags & PARSE_FLAG_ASM_FILE);
1362+ isidnum_table['.' - CH_EOF] =
1363+ (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
13611364 }
13621365 tok_str_new(&str);
13631366 spc = 2;
@@ -2476,8 +2479,6 @@ maybe_newline: · 1112 unmodified lines
24762479 p1 = p;
24772480 h = TOK_HASH_INIT;
24782481 h = TOK_HASH_FUNC(h, c);
2479− isidnum_table['.' - CH_EOF] =
2480− (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
24812482 while (c = *++p, isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
24822483 h = TOK_HASH_FUNC(h, c);
24832484 if (c != '\\') {
@@ -2532,8 +2533,6 @@ maybe_newline: · 48 unmodified lines
25322533 } else {
25332534 cstr_reset(&tokcstr);
25342535 cstr_ccat(&tokcstr, 'L');
2535− isidnum_table['.' - CH_EOF] =
2536− (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
25372536 goto parse_ident_slow;
25382537 }
25392538 }
@@ -3369,6 +3368,9 @@ ST_FUNC void preprocess_init(TCCState *s1) · 829 unmodified lines
33693368
33703369 isidnum_table['$' - CH_EOF] =
33713370 tcc_state->dollars_in_identifiers ? IS_ID : 0;
3371+
3372+ isidnum_table['.' - CH_EOF] =
3373+ (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
33723374 }
33733375
33743376 ST_FUNC void preprocess_new(void)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t