History

Identifiers can start and/or contain '.' in PARSE_FLAG_ASM_FILE

Including labels, directives and section names

Vlad Vissoultchev committed 10 years ago

Commit 05ec6651 parent 17395ea1 file · +8 −10Browse files

Unified · Split

tccpp.c+8−10
@@ -2550,15 +2550,12 @@ maybe_newline: · 2549 unmodified lines
2550 cstr_reset(&tokcstr);2550 cstr_reset(&tokcstr);
2551 cstr_ccat(&tokcstr, '.');2551 cstr_ccat(&tokcstr, '.');
2552 goto parse_num;2552 goto parse_num;
2553 } else if (c == '.') {2553 } else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */
2554 PEEKC(c, p);2554 *--p = c = '.';
2555 if (c == '.') {2555 goto parse_ident_fast;
2556 p++;2556 } else if (c == '.' && p[1] == '.') {
2557 tok = TOK_DOTS;2557 p += 2;
2558 } else {2558 tok = TOK_DOTS;
2559 *--p = '.'; /* may underflow into file->unget[] */
2560 tok = '.';
2561 }
2562 } else {2559 } else {
2563 tok = '.';2560 tok = '.';
2564 }2561 }
@@ -3342,8 +3339,9 @@ ST_FUNC void preprocess_init(TCCState *s1) · 777 unmodified lines
3342 s1->pack_stack[0] = 0;3339 s1->pack_stack[0] = 0;
3343 s1->pack_stack_ptr = s1->pack_stack;3340 s1->pack_stack_ptr = s1->pack_stack;
3344 3341
3345 isidnum_table['$' - CH_EOF] =3342 isidnum_table['$' - CH_EOF] = (parse_flags & PARSE_FLAG_ASM_FILE) ||
3346 tcc_state->dollars_in_identifiers ? IS_ID : 0;3343 tcc_state->dollars_in_identifiers ? IS_ID : 0;
3344 isidnum_table['.' - CH_EOF] = (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
3347}3345}
3348 3346
3349ST_FUNC void preprocess_new(void)3347ST_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