File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -5526,7 +5526,7 @@ impl<'a> Parser<'a> {
5526
5526
}
5527
5527
5528
5528
pub fn parse_function_args ( & mut self ) -> Result < FunctionArg , ParserError > {
5529
- if self . peek_nth_token ( 1 ) . token == Token :: RArrow {
5529
+ if self . peek_nth_token ( 1 ) == Token :: RArrow {
5530
5530
let name = self . parse_identifier ( ) ?;
5531
5531
5532
5532
self . expect_token ( & Token :: RArrow ) ?;
Original file line number Diff line number Diff line change @@ -329,6 +329,12 @@ impl TokenWithLocation {
329
329
}
330
330
}
331
331
332
+ impl PartialEq < Token > for TokenWithLocation {
333
+ fn eq ( & self , other : & Token ) -> bool {
334
+ & self . token == other
335
+ }
336
+ }
337
+
332
338
impl fmt:: Display for TokenWithLocation {
333
339
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
334
340
self . token . fmt ( f)
@@ -474,7 +480,8 @@ impl<'a> Tokenizer<'a> {
474
480
chars. next ( ) ; // consume, to check the next char
475
481
match chars. peek ( ) {
476
482
Some ( '\'' ) => {
477
- let s = self . tokenize_escaped_single_quoted_string ( starting_loc, chars) ?;
483
+ let s =
484
+ self . tokenize_escaped_single_quoted_string ( starting_loc, chars) ?;
478
485
Ok ( Some ( Token :: EscapedStringLiteral ( s) ) )
479
486
}
480
487
_ => {
@@ -933,8 +940,10 @@ impl<'a> Tokenizer<'a> {
933
940
last_ch = ch;
934
941
}
935
942
None => {
936
- break self
937
- . tokenizer_error ( chars. location ( ) , "Unexpected EOF while in a multi-line comment" )
943
+ break self . tokenizer_error (
944
+ chars. location ( ) ,
945
+ "Unexpected EOF while in a multi-line comment" ,
946
+ )
938
947
}
939
948
}
940
949
}
You can’t perform that action at this time.
0 commit comments