diff options
author | Raiki Tamura <tamaron1203@gmail.com> | 2024-08-29 02:48:29 +0900 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-19 15:32:05 +0100 |
commit | bb0abd09cf8038bb8c1c0184f2d7ae83b6527540 (patch) | |
tree | e91bc3f45b61a6b0d1ba3d088be72adb613c63e1 /gcc | |
parent | 4f58a20d7e27aaa63e21dba072013b496baa94d1 (diff) | |
download | gcc-bb0abd09cf8038bb8c1c0184f2d7ae83b6527540.zip gcc-bb0abd09cf8038bb8c1c0184f2d7ae83b6527540.tar.gz gcc-bb0abd09cf8038bb8c1c0184f2d7ae83b6527540.tar.bz2 |
gccrs: emit error code for E0758
gcc/rust/ChangeLog:
* lex/rust-lex.cc (Lexer::build_token): Emit error code.
* lex/rust-lex.h: Fix comment.
Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/lex/rust-lex.cc | 9 | ||||
-rw-r--r-- | gcc/rust/lex/rust-lex.h | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index f4b8861..8490638 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -589,7 +589,8 @@ Lexer::build_token () if (current_char.is_eof ()) { rust_error_at ( - loc, "unexpected EOF while looking for end of comment"); + loc, ErrorCode::E0758, + "unexpected EOF while looking for end of comment"); break; } str += current_char; @@ -644,7 +645,8 @@ Lexer::build_token () if (current_char.is_eof ()) { rust_error_at ( - loc, "unexpected EOF while looking for end of comment"); + loc, ErrorCode::E0758, + "unexpected EOF while looking for end of comment"); break; } @@ -708,7 +710,8 @@ Lexer::build_token () if (current_char.is_eof ()) { rust_error_at ( - loc, "unexpected EOF while looking for end of comment"); + loc, ErrorCode::E0758, + "unexpected EOF while looking for end of comment"); break; } diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h index 8265ca8..10293e0 100644 --- a/gcc/rust/lex/rust-lex.h +++ b/gcc/rust/lex/rust-lex.h @@ -115,14 +115,15 @@ private: // Request new Location for current column in line_table location_t get_current_location (); - // Skips the current input char. + // Skips the current input character. void skip_input (); - // Advances current input char to n + 1 chars ahead of current position. + // Advances current input character to n + 1 characters ahead of current + // position. void skip_input (int n); - // Peeks the current char. + // Peeks the current character. Codepoint peek_input (); - // Returns char n bytes ahead of current position. + // Returns character n characters ahead of current position. Codepoint peek_input (int n); // Classifies keyword (i.e. gets id for keyword). |