diff options
| author | seyko <seyko2@gmail.com> | 2016-04-05 15:06:47 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2016-04-05 15:06:47 +0300 |
| commit | effc7d9ed4e421527e263d981ff910c389ccf154 (patch) | |
| tree | bbfba130207394a3244d013d88f15e2486a629d5 /tccpp.c | |
| parent | 983c40f58ba92c5958f731ce8d5246fea601aa30 (diff) | |
| download | tinycc-effc7d9ed4e421527e263d981ff910c389ccf154.tar.gz tinycc-effc7d9ed4e421527e263d981ff910c389ccf154.tar.bz2 | |
cleaning "Identifiers can start and/or contain"
more logical algorithm of the isidnum_table[] changing
Diffstat (limited to 'tccpp.c')
| -rw-r--r-- | tccpp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1330,6 +1330,7 @@ ST_FUNC void parse_define(void) if (tok == '(') { /* must be able to parse TOK_DOTS (in asm mode '.' can be part of identifier) */ parse_flags &= ~PARSE_FLAG_ASM_FILE; + isidnum_table['.' - CH_EOF] = 0; next_nomacro(); ps = &first; if (tok != ')') for (;;) { @@ -1358,6 +1359,8 @@ ST_FUNC void parse_define(void) next_nomacro_spc(); t = MACRO_FUNC; parse_flags |= (saved_parse_flags & PARSE_FLAG_ASM_FILE); + isidnum_table['.' - CH_EOF] = + (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; } tok_str_new(&str); spc = 2; @@ -2476,8 +2479,6 @@ maybe_newline: p1 = p; h = TOK_HASH_INIT; h = TOK_HASH_FUNC(h, c); - isidnum_table['.' - CH_EOF] = - (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; while (c = *++p, isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM)) h = TOK_HASH_FUNC(h, c); if (c != '\\') { @@ -2532,8 +2533,6 @@ maybe_newline: } else { cstr_reset(&tokcstr); cstr_ccat(&tokcstr, 'L'); - isidnum_table['.' - CH_EOF] = - (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; goto parse_ident_slow; } } @@ -3369,6 +3368,9 @@ ST_FUNC void preprocess_init(TCCState *s1) isidnum_table['$' - CH_EOF] = tcc_state->dollars_in_identifiers ? IS_ID : 0; + + isidnum_table['.' - CH_EOF] = + (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; } ST_FUNC void preprocess_new(void) |
