aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-01-27 01:43:17 +0000
committerJeff Law <law@gcc.gnu.org>1999-01-26 18:43:17 -0700
commitab87f8c8d19d6b0954516d7f1d8733f42076be81 (patch)
treee7daf0f28ecb5da9660b21aee68e6919f846c183 /gcc/c-lex.c
parent01b4cf2b7a1fe9a3f6f070217be5f93854c54545 (diff)
downloadgcc-ab87f8c8d19d6b0954516d7f1d8733f42076be81.zip
gcc-ab87f8c8d19d6b0954516d7f1d8733f42076be81.tar.gz
gcc-ab87f8c8d19d6b0954516d7f1d8733f42076be81.tar.bz2
Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
details. From-SVN: r24879
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 1b44817..71a21aa 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -22,6 +22,10 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include <setjmp.h>
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
#include "rtl.h"
#include "tree.h"
#include "input.h"
@@ -32,6 +36,18 @@ Boston, MA 02111-1307, USA. */
#include "c-parse.h"
#include "c-pragma.h"
#include "toplev.h"
+#include "intl.h"
+
+#ifdef MAP_CHARACTER
+#include <ctype.h>
+#endif
+
+/* MULTIBYTE_CHARS support only works for native compilers.
+ ??? Ideally what we want is to model widechar support after
+ the current floating point support. */
+#ifdef CROSS_COMPILE
+#undef MULTIBYTE_CHARS
+#endif
#ifdef MULTIBYTE_CHARS
#include "mbchar.h"
@@ -221,6 +237,8 @@ finish_parse ()
void
init_lex ()
{
+ char *p;
+
/* Make identifier nodes long enough for the language-specific slots. */
set_identifier_size (sizeof (struct lang_identifier));
@@ -1040,30 +1058,25 @@ readescape (ignore_ptr)
}
void
-yyerror (string)
- char *string;
+yyerror (msgid)
+ char *msgid;
{
- char buf[200];
-
- strcpy (buf, string);
+ char *string = _(msgid);
/* We can't print string and character constants well
because the token_buffer contains the result of processing escapes. */
if (end_of_file)
- strcat (buf, " at end of input");
+ error ("%s at end of input", string);
else if (token_buffer[0] == 0)
- strcat (buf, " at null character");
+ error ("%s at null character", string);
else if (token_buffer[0] == '"')
- strcat (buf, " before string constant");
+ error ("%s before string constant", string);
else if (token_buffer[0] == '\'')
- strcat (buf, " before character constant");
+ error ("%s before character constant", string);
else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177)
- sprintf (buf + strlen (buf), " before character 0%o",
- (unsigned char) token_buffer[0]);
+ error ("%s before character 0%o", string, (unsigned char) token_buffer[0]);
else
- strcat (buf, " before `%s'");
-
- error (buf, token_buffer);
+ error ("%s before `%s'", string, token_buffer);
}
#if 0
@@ -1197,8 +1210,6 @@ yylex ()
while (ISALNUM (c) || c == '_' || c == '$' || c == '@')
{
/* Make sure this char really belongs in an identifier. */
- if (c == '@' && ! doing_objc_thang)
- break;
if (c == '$')
{
if (! dollars_in_ident)