Skip to content

gccrs: emit error code for E0758 #3145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions gcc/rust/lex/rust-lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
9 changes: 5 additions & 4 deletions gcc/rust/lex/rust-lex.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ class Lexer
// 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).
Expand Down
Loading