-
Notifications
You must be signed in to change notification settings - Fork 167
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
Remove unnecessary methods/fields of Rust::Lexer
#2347
Conversation
gcc/rust/ChangeLog: * lex/rust-lex.cc (Lexer::build_token): Replace function call. (Lexer::parse_string): Likewise. (Lexer::parse_identifier_or_keyword): Likewise. (Lexer::parse_raw_string): Likewise. (Lexer::parse_char_or_lifetime): Likewise. (Lexer::get_input_codepoint_length): Deleted. (Lexer::peek_codepoint_input): Deleted. (Lexer::skip_codepoint_input): Deleted. * lex/rust-lex.h: Remove some methods and fields Signed-off-by: Raiki Tamura <[email protected]>
// FIXME: should remove this but can't. | ||
// `parse_utf8_escape` does not update `current_char` correctly. | ||
current_char = peek_input (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be removed but can't.
parse_utf8_escape()
seems not to update current_char
properly.
int get_input_codepoint_length (); | ||
// Peeks the current utf-8 char | ||
Codepoint peek_codepoint_input (); | ||
void skip_codepoint_input (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are unnecessary so deleted in this pr(See #2307)
@@ -393,7 +389,6 @@ class Lexer | |||
int current_column; | |||
// Current character. | |||
Codepoint current_char; | |||
Codepoint current_char32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field was added to parse Unicode identifiers via #2284 but is unnecessary now.
@CohenArthur apt-get fails in CI. How can i rerun tests? |
@tamaroning I re-ran the CI manually. Not sure why it failed on this step, but yeah this is not your fault so don't worry :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Very nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Addresses #2309