]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: emit error code for E0758
authorRaiki Tamura <tamaron1203@gmail.com>
Wed, 28 Aug 2024 17:48:29 +0000 (02:48 +0900)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:05 +0000 (15:32 +0100)
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>
gcc/rust/lex/rust-lex.cc
gcc/rust/lex/rust-lex.h

index f4b8861adcc6861b0d746fd2f8d0f70d5785dc27..849063824dcf61a0b891a1d068e6af563ca53d46 100644 (file)
@@ -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;
                    }
 
index 8265ca8239f8d7e0108c048f6684f9c719152029..10293e0a81228b08e6e64ecc4e73dced47890493 100644 (file)
@@ -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).