diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-11-27 22:31:34 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-11-27 22:31:34 +0000 |
commit | 0abc6a6a4f074142719263a69355b702ac92f79b (patch) | |
tree | 3c52b3d011b38afeffe23926fc3afa478dd62aa8 /gcc/cpplex.c | |
parent | 9827f778db2e051f0803ef226ee3076fd7ef9d20 (diff) | |
download | gcc-0abc6a6a4f074142719263a69355b702ac92f79b.zip gcc-0abc6a6a4f074142719263a69355b702ac92f79b.tar.gz gcc-0abc6a6a4f074142719263a69355b702ac92f79b.tar.bz2 |
cpphash.c (_cpp_init_hashtable): Update.
* cpphash.c (_cpp_init_hashtable): Update.
* cpphash.h (struct spec_nodes): Remove n_L.
* cpplex.c (_cpp_lex_direct): Check for prefix L separately.
* Makefile.in: Update, and add c-objc-common.o dependencies.
* c-lang.c: Remove unnecessary includes.
(c_init): Move bulk of code to c_objc_common_init, and call it.
(c_tree_printer, c_missing_noreturn_ok_p, c_disregard_inline_limits,
inline_forbidden_p, c_cannot_inline_tree_fn): Move to
c-objc-common.c.
* c-objc-common.c: New. Mostly pulled from c-lang.c.
* c-tree.h (c_disregard_inline_limits, c_cannot_inline_fn,
c_objc_common_init, c_missing_noreturn_ok_p): New.
* toplev.c: Update comment.
* doc/passes.texi: Update.
* objc/ojbc-act.c (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Override.
(objc_init): Update to use c_objc_common_init.
From-SVN: r47388
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 08223bd..dc17f63 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -978,11 +978,23 @@ _cpp_lex_direct (pfile) parse_number (pfile, &result->val.str, c, 0); break; - case '$': - if (!CPP_OPTION (pfile, dollars_in_ident)) - goto random_char; - /* Fall through... */ + case 'L': + /* 'L' may introduce wide characters or strings. */ + { + const unsigned char *pos = buffer->cur; + c = get_effective_char (pfile); + if (c == '\'' || c == '"') + { + result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR); + parse_string (pfile, result, c); + break; + } + buffer->cur = pos; + } + /* Fall through. */ + + start_ident: case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -990,26 +1002,15 @@ _cpp_lex_direct (pfile) case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': result->type = CPP_NAME; result->val.node = parse_identifier (pfile); - /* 'L' may introduce wide characters or strings. */ - if (result->val.node == pfile->spec_nodes.n_L) - { - c = *buffer->cur; - if (c == '\'' || c == '"') - { - buffer->cur++; - result->type = (c == '"' ? CPP_WSTRING: CPP_WCHAR); - parse_string (pfile, result, c); - } - } /* Convert named operators to their proper types. */ - else if (result->val.node->flags & NODE_OPERATOR) + if (result->val.node->flags & NODE_OPERATOR) { result->flags |= NAMED_OP; result->type = result->val.node->value.operator; @@ -1273,6 +1274,11 @@ _cpp_lex_direct (pfile) /* @ is a punctuator in Objective C. */ case '@': result->type = CPP_ATSIGN; break; + case '$': + if (CPP_OPTION (pfile, dollars_in_ident)) + goto start_ident; + /* Fall through... */ + random_char: default: result->type = CPP_OTHER; |