diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2000-08-04 01:30:06 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-08-04 01:30:06 +0000 |
commit | ba89d661ac573f2402fa4f3b4cb117c8c74968e2 (patch) | |
tree | 254d84e8b966d54bb05be43ebe0b47a16be7a4ea /gcc/cppmacro.c | |
parent | d31772ca70b9d2a315372456bfdf343c3806a3f8 (diff) | |
download | gcc-ba89d661ac573f2402fa4f3b4cb117c8c74968e2.zip gcc-ba89d661ac573f2402fa4f3b4cb117c8c74968e2.tar.gz gcc-ba89d661ac573f2402fa4f3b4cb117c8c74968e2.tar.bz2 |
cpplex.c (parse_name): Might have to glue a CPP_OTHER token before the name.
* cpplex.c (parse_name): Might have to glue a CPP_OTHER token
before the name.
(lex_line): Glue @ onto the beginning of identifiers and
string constants, in Objective-C mode.
(output_token, spell_token): Handle CPP_OSTRING.
(can_paste, maybe_paste_with_next): Handle pasting @ onto the
beginning of a NAME or a STRING, in objc mode.
* cpplib.c (get_define_node): Do not permit identifiers that
begin with @ to be #defined.
* cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER.
* cpplib.h (TTYPE_TABLE): Add CPP_OSTRING.
* c-lang.c, objc/objc-act.c (build_objc_string): Delete.
* c-tree.h (build_objc_string): Delete prototype.
* objc/objc-tree.def: Delete OBJC_STRING_CST.
* c-lex.c (yylex): Use build_string for all three kinds of strings.
* gcc.dg/cpp/20000625-2.c: Don't expect a warning on line 4.
From-SVN: r35470
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index b78e5f0..00f2dfb 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -55,12 +55,14 @@ static cpp_toklist * alloc_macro PARAMS ((cpp_reader *, struct macro_info *)); /* These are all the tokens that can have something pasted after them. Comma is included in the list only to support the GNU varargs extension - (where you write a ## b and a disappears if b is an empty rest argument). */ + (where you write a ## b and a disappears if b is an empty rest argument). + CPP_OTHER is included because of Objective C's use of '@'. */ #define CAN_PASTE_AFTER(type) \ ((type) <= CPP_LAST_EQ || (type) == CPP_COLON || (type) == CPP_HASH \ || (type) == CPP_DEREF || (type) == CPP_DOT || (type) == CPP_NAME \ || (type) == CPP_INT || (type) == CPP_FLOAT || (type) == CPP_NUMBER \ - || (type) == CPP_MACRO_ARG || (type) == CPP_PLACEMARKER || (type) == CPP_COMMA) + || (type) == CPP_MACRO_ARG || (type) == CPP_PLACEMARKER \ + || (type) == CPP_COMMA || (type) == CPP_OTHER) /* Scans for a given token, returning the parameter number if found, or 0 if not found. Scans from FIRST to TOKEN - 1 or the first |