diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-12-04 15:27:26 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-12-04 15:27:26 +0000 |
commit | 9da783d1b71bb5e8add0cf74527786d0e4255803 (patch) | |
tree | 3875dd8ee1757432a8aac855118a12ce748e2f21 /gcc/rust/lex | |
parent | 0bf68cf5e6199ce7deb3d0744ced09dd4db1b1c9 (diff) | |
download | gcc-9da783d1b71bb5e8add0cf74527786d0e4255803.zip gcc-9da783d1b71bb5e8add0cf74527786d0e4255803.tar.gz gcc-9da783d1b71bb5e8add0cf74527786d0e4255803.tar.bz2 |
Revert "rust: Remove unused variables and fix dangling references"
This reverts commit 9657c328d0cdda49b7985c3ee727781a387e128b.
Diffstat (limited to 'gcc/rust/lex')
-rw-r--r-- | gcc/rust/lex/rust-lex.cc | 6 | ||||
-rw-r--r-- | gcc/rust/lex/rust-lex.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index ea17ecc..8028c1b 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -1364,7 +1364,7 @@ Lexer::parse_escape (char opening_char) /* Parses an escape (or string continue) in a string or character. Supports * unicode escapes. */ std::tuple<Codepoint, int, bool> -Lexer::parse_utf8_escape () +Lexer::parse_utf8_escape (char opening_char) { Codepoint output_char; int additional_length_offset = 0; @@ -1964,7 +1964,7 @@ Lexer::parse_string (Location loc) if (current_char32.value == '\\') { // parse escape - auto utf8_escape_pair = parse_utf8_escape (); + auto utf8_escape_pair = parse_utf8_escape ('\''); current_char32 = std::get<0> (utf8_escape_pair); if (current_char32 == Codepoint (0) && std::get<2> (utf8_escape_pair)) @@ -2365,7 +2365,7 @@ Lexer::parse_char_or_lifetime (Location loc) if (current_char32.value == '\\') { // parse escape - auto utf8_escape_pair = parse_utf8_escape (); + auto utf8_escape_pair = parse_utf8_escape ('\''); current_char32 = std::get<0> (utf8_escape_pair); length += std::get<1> (utf8_escape_pair); diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h index c05e267..2e8a1c5 100644 --- a/gcc/rust/lex/rust-lex.h +++ b/gcc/rust/lex/rust-lex.h @@ -109,7 +109,7 @@ private: std::pair<std::string, int> parse_in_exponent_part (); std::pair<PrimitiveCoreType, int> parse_in_type_suffix (); std::tuple<char, int, bool> parse_escape (char opening_char); - std::tuple<Codepoint, int, bool> parse_utf8_escape (); + std::tuple<Codepoint, int, bool> parse_utf8_escape (char opening_char); int parse_partial_string_continue (); std::pair<long, int> parse_partial_hex_escape (); std::pair<Codepoint, int> parse_partial_unicode_escape (); |