Use get_kind()
This commit is contained in:
parent
8eda74c9a5
commit
d0c5dce92b
@ -61,9 +61,7 @@ impl TokenHandler {
|
|||||||
fn new(tokens: Vec<Token>) -> TokenHandler {
|
fn new(tokens: Vec<Token>) -> TokenHandler {
|
||||||
let end_of_file = match tokens.last() {
|
let end_of_file = match tokens.last() {
|
||||||
None => (0, 0),
|
None => (0, 0),
|
||||||
Some(s) => {
|
Some(s) => s.offset.clone(),
|
||||||
s.offset.clone()
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let tokens = tokens.into_iter().peekable();
|
let tokens = tokens.into_iter().peekable();
|
||||||
TokenHandler { tokens, end_of_file }
|
TokenHandler { tokens, end_of_file }
|
||||||
@ -1007,8 +1005,7 @@ impl Parser {
|
|||||||
use self::ExpressionType::*;
|
use self::ExpressionType::*;
|
||||||
|
|
||||||
let tok = self.token_handler.peek_token();
|
let tok = self.token_handler.peek_token();
|
||||||
let kind = tok.kind.clone();
|
match tok.get_kind() {
|
||||||
match kind {
|
|
||||||
DigitGroup(_) | HexLiteral(_) | BinNumberSigil | Period => self.number_literal(),
|
DigitGroup(_) | HexLiteral(_) | BinNumberSigil | Period => self.number_literal(),
|
||||||
Keyword(Kw::True) => {
|
Keyword(Kw::True) => {
|
||||||
self.next();
|
self.next();
|
||||||
|
Loading…
Reference in New Issue
Block a user