WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,8 @@ impl<'a> Parser<'a> {
131131 /// 1. Advancing the pointer to the current token at least once
132132 /// 2. Invoking the prefix expression parse function for the `previous_token`
133133 /// 3. Successively advancing the pointer to the current token and calling the infix expression
134- /// parse function for the `current_token` while its precedence is lower than the one that is
135- /// provided. Lower precedences will subsume more/larger expressions.
134+ /// parse function for the `current_token` while its precedence is lower than the one that is
135+ /// provided. Lower precedences will subsume more/larger expressions.
136136 ///
137137 /// # Arguments
138138 /// - `precedence` the precedence of the current token
@@ -200,7 +200,7 @@ impl<'a> Parser<'a> {
200200 ///
201201 /// * `token_type` - The expected token type that the parser's `current_token` is sitting on
202202 /// * `error_msg` - The error message that should be emitted if the `current_token`'s type does
203- /// not match `token_type`
203+ /// not match `token_type`
204204 fn consume ( & mut self , token_type : & TokenType , error_msg : & str ) {
205205 if self . current_token . expect ( "No token type" ) . token_type == token_type {
206206 self . advance ( ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl Value {
2525 let mut decimal_flag = false ;
2626
2727 for char in val. chars ( ) {
28- let is_scientific = char. to_ascii_lowercase ( ) == 'e' ;
28+ let is_scientific = char. eq_ignore_ascii_case ( & 'e' ) ;
2929 let is_one_time_prefix = char == '+' || char == '-' ;
3030 let is_decimal = char == '.' ;
3131
Original file line number Diff line number Diff line change @@ -516,9 +516,8 @@ impl VM {
516516
517517 fn peek ( & mut self , distance : usize ) -> & Value {
518518 let last_index = self . stack . len ( ) - 1 ;
519- return self
520- . stack
519+ self . stack
521520 . get ( last_index - distance)
522- . expect ( "Unable to peek at stack!" ) ;
521+ . expect ( "Unable to peek at stack!" )
523522 }
524523}
You can’t perform that action at this time.
0 commit comments