diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-01-19 16:14:12 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-01-20 10:01:43 +0000 |
commit | 23edde6fef4321d30f9f2f8c75e6cbfd59b75ca4 (patch) | |
tree | ff346f3525b1db3a3aa35e6ab1bcf2e215dcbdf5 /gcc | |
parent | f6d33adc6656839aebb4dca02df8efc8be6aedd2 (diff) | |
download | gcc-23edde6fef4321d30f9f2f8c75e6cbfd59b75ca4.zip gcc-23edde6fef4321d30f9f2f8c75e6cbfd59b75ca4.tar.gz gcc-23edde6fef4321d30f9f2f8c75e6cbfd59b75ca4.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/lex/rust-lex.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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 |