Whitespace

pull/2/head
Mark 2023-06-07 14:37:23 -07:00
parent 03d081fe06
commit 156b94c937
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 4 additions and 4 deletions

View File

@ -8,12 +8,12 @@ use crate::tokens::Operator;
// Called whenever a token is finished. // Called whenever a token is finished.
#[inline(always)] #[inline(always)]
fn push_token(g: &mut VecDeque<PreToken>, t: Option<PreToken>, stop_i: usize) { fn push_token(g: &mut VecDeque<PreToken>, t: Option<PreToken>, stop_i: usize) {
if t.is_none() { return } if t.is_none() { return }
let mut t = t.unwrap(); let mut t = t.unwrap();
match t { match t {
PreToken::PreGroupStart(ref mut l) PreToken::PreGroupStart(ref mut l)
| PreToken::PreGroupEnd(ref mut l) | PreToken::PreGroupEnd(ref mut l)
| PreToken::PreOperator(ref mut l, _) | PreToken::PreOperator(ref mut l, _)
| PreToken::PreNumber(ref mut l, _) | PreToken::PreNumber(ref mut l, _)
@ -62,7 +62,7 @@ fn push_token(g: &mut VecDeque<PreToken>, t: Option<PreToken>, stop_i: usize) {
/// Turns a string into Tokens. First stage of parsing. /// Turns a string into Tokens. First stage of parsing.
pub(in crate::parser) fn tokenize(input: &String) -> VecDeque<PreToken> { pub(in crate::parser) fn tokenize(input: &String) -> VecDeque<PreToken> {
let mut t: Option<PreToken> = None; // The current token we're reading let mut t: Option<PreToken> = None; // The current token we're reading
let mut g: VecDeque<PreToken> = VecDeque::with_capacity(32); let mut g: VecDeque<PreToken> = VecDeque::with_capacity(32);
for (i, c) in input.chars().enumerate() { for (i, c) in input.chars().enumerate() {
@ -145,7 +145,7 @@ pub(in crate::parser) fn tokenize(input: &String) -> VecDeque<PreToken> {
} }
}; };
}, },
// Group // Group
'(' => { '(' => {
push_token(&mut g, t, i); push_token(&mut g, t, i);