Skip to content

Commit 2501644

Browse files
tamaroningCohenArthur
authored andcommitted
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 <[email protected]>
1 parent 5da381f commit 2501644

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

gcc/rust/lex/rust-lex.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ Lexer::build_token ()
589589
if (current_char.is_eof ())
590590
{
591591
rust_error_at (
592-
loc, "unexpected EOF while looking for end of comment");
592+
loc, ErrorCode::E0758,
593+
"unexpected EOF while looking for end of comment");
593594
break;
594595
}
595596
str += current_char;
@@ -644,7 +645,8 @@ Lexer::build_token ()
644645
if (current_char.is_eof ())
645646
{
646647
rust_error_at (
647-
loc, "unexpected EOF while looking for end of comment");
648+
loc, ErrorCode::E0758,
649+
"unexpected EOF while looking for end of comment");
648650
break;
649651
}
650652

@@ -708,7 +710,8 @@ Lexer::build_token ()
708710
if (current_char.is_eof ())
709711
{
710712
rust_error_at (
711-
loc, "unexpected EOF while looking for end of comment");
713+
loc, ErrorCode::E0758,
714+
"unexpected EOF while looking for end of comment");
712715
break;
713716
}
714717

gcc/rust/lex/rust-lex.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ class Lexer
115115
// Request new Location for current column in line_table
116116
location_t get_current_location ();
117117

118-
// Skips the current input char.
118+
// Skips the current input character.
119119
void skip_input ();
120-
// Advances current input char to n + 1 chars ahead of current position.
120+
// Advances current input character to n + 1 characters ahead of current
121+
// position.
121122
void skip_input (int n);
122123

123-
// Peeks the current char.
124+
// Peeks the current character.
124125
Codepoint peek_input ();
125-
// Returns char n bytes ahead of current position.
126+
// Returns character n characters ahead of current position.
126127
Codepoint peek_input (int n);
127128

128129
// Classifies keyword (i.e. gets id for keyword).

0 commit comments

Comments
 (0)