From 23edde6fef4321d30f9f2f8c75e6cbfd59b75ca4 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 19 Jan 2021 16:14:12 +0000 Subject: Fixes the ^= and %= compound expression parsing. The input needed to be skipped once the operator was parsed to ensure the lexer did not duplicate the operator. |= still fails but this looks to be a parser problem. --- gcc/rust/lex/rust-lex.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index 4606a6c..6dfaea2 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -466,7 +466,9 @@ Lexer::build_token () if (peek_input () == '=') { // modulo-assign + skip_input (); current_column += 2; + return Token::make (PERCENT_EQ, loc); } else @@ -479,7 +481,9 @@ Lexer::build_token () if (peek_input () == '=') { // xor-assign? + skip_input (); current_column += 2; + return Token::make (CARET_EQ, loc); } else -- cgit v1.1