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
25502550 cstr_reset(&tokcstr);
25512551 cstr_ccat(&tokcstr, '.');
25522552 goto parse_num;
2553− } else if (c == '.') {
2554− PEEKC(c, p);
2555− if (c == '.') {
2556− p++;
2557− tok = TOK_DOTS;
2558− } else {
2559− *--p = '.'; /* may underflow into file->unget[] */
2560− tok = '.';
2561− }
2553+ } else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */
2554+ *--p = c = '.';
2555+ goto parse_ident_fast;
2556+ } else if (c == '.' && p[1] == '.') {
2557+ p += 2;
2558+ tok = TOK_DOTS;
25622559 } else {
25632560 tok = '.';
25642561 }
@@ -3342,8 +3339,9 @@ ST_FUNC void preprocess_init(TCCState *s1) · 777 unmodified lines
33423339 s1->pack_stack[0] = 0;
33433340 s1->pack_stack_ptr = s1->pack_stack;
33443341
3345− isidnum_table['$' - CH_EOF] =
3342+ isidnum_table['$' - CH_EOF] = (parse_flags & PARSE_FLAG_ASM_FILE) ||
33463343 tcc_state->dollars_in_identifiers ? IS_ID : 0;
3344+ isidnum_table['.' - CH_EOF] = (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
33473345 }
33483346
33493347 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