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
Rename glue
and refactor push_tree
#106481
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -710,7 +710,11 @@ impl Token { | |
} | ||
} | ||
|
||
pub fn glue(&self, joint: &Token) -> Option<Token> { | ||
/// Checks if the current token is a multiple-character token (or glued like `==`, `<=`, `...`) | ||
/// and returns the corresponding `TokenKind` if it is. | ||
/// | ||
/// if the current tokens is already complete, returns `None`. | ||
pub fn check_is_multiple_char_token(&self, joint: &Token) -> Option<Token> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer the name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Certainly it doesn't seem very practical. Thank you for your feedback. |
||
let kind = match self.kind { | ||
Eq => match joint.kind { | ||
Eq => EqEq, | ||
|
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.
I don't think this comment explains what this method is doing properly.
What this is doing is checking if the current token can be combined with the
joint
token to turn into a multiple-character token.