aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/lex.c
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1999-02-19 08:33:22 -0800
committerPer Bothner <bothner@gcc.gnu.org>1999-02-19 08:33:22 -0800
commitdc0b3eff7222829d8ae75f4791aa16e617a03f23 (patch)
treeeba87d455cc8640b3e17a6c95b007f65a6035406 /gcc/java/lex.c
parent68ae3b17eb0110b389d4caa7eee9c433843e7c73 (diff)
downloadgcc-dc0b3eff7222829d8ae75f4791aa16e617a03f23.zip
gcc-dc0b3eff7222829d8ae75f4791aa16e617a03f23.tar.gz
gcc-dc0b3eff7222829d8ae75f4791aa16e617a03f23.tar.bz2
Force left-to-right evaluation of binary operations etc.
d Force left-to-right evaluation of binary operations etc. * expr.c (force_evaluation_order), java-tree.h: New function. * parse.y (java_complete_lhs): Pass binary operations, procedure calls, and ARRAY_REFs to force_evaluation_order. (various): Set TREE_SIDE_EFFECTS more carefully. Tolerate random (non-UTF8) encoding in comments without complaining. * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding. (java_is_eol): Handle '\r' followed by '\n' instead of vice versa. * parse.y (resolve_qualified_expression_name): Handle error_mark. (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise. * parse.y (java_complete_lhs): Ignore an empty statement in a COMPOUND_EXPR. Don't complain about empty statement after return. From-SVN: r25328
Diffstat (limited to 'gcc/java/lex.c')
-rw-r--r--gcc/java/lex.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 89b3fb2..98606cc 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -197,6 +197,8 @@ java_allocate_new_line ()
ctxp->c_line->white_space_only = 1;
}
+#define BAD_UTF8_VALUE 0xFFFE
+
static unicode_t
java_read_char ()
{
@@ -235,9 +237,8 @@ java_read_char ()
(( c1 & 0x3f) << 6) + (c2 & 0x3f));
}
}
- java_lex_error ("Bad utf8 encoding", 0);
+ return BAD_UTF8_VALUE;
}
- return 0;
}
static void
@@ -1312,12 +1313,12 @@ java_is_eol (fp, c)
int next;
switch (c)
{
- case '\n':
+ case '\r':
next = getc (fp);
- if (next != '\r' && next != EOF)
+ if (next != '\n' && next != EOF)
ungetc (next, fp);
return 1;
- case '\r':
+ case '\n':
return 1;
default:
return 0;