From 47c4a421ac6d8b1670b9d5525d11f92f71718321 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Fri, 19 Jun 2020 22:47:06 -0400 Subject: [PATCH] upgrade dependencies --- Cargo.toml | 20 ++++++++++---------- src/parse/ident.rs | 2 +- src/parse/mod.rs | 4 ++-- src/parse/style.rs | 8 ++++---- src/parse/value.rs | 12 ++++++------ src/parse/variable.rs | 2 +- src/selector/attribute.rs | 4 ++-- src/selector/parse.rs | 4 ++-- src/utils/number.rs | 2 +- src/utils/peek_until.rs | 18 +++++++++--------- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac2165a..405c2ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ required-features = ["commandline"] [lib] name = "grass" path = "src/lib.rs" -crate-type = ["cdylib", "rlib"] +# crate-type = ["cdylib", "rlib"] bench = false [[bench]] @@ -45,15 +45,15 @@ harness = false [dependencies] -clap = { version = "2.33.0", optional = true } -num-rational = "0.2.3" -num-bigint = "0.2.6" -num-traits = "0.2.11" -once_cell = "1.3.1" +clap = { version = "2.33.1", optional = true } +num-rational = "0.3.0" +num-bigint = "0.3.0" +num-traits = "0.2.12" +once_cell = "1.4.0" rand = { version = "0.7.3", optional = true } codemap = "0.1.3" -peekmore = "0.4.0" -wasm-bindgen = { version = "0.2.60", optional = true } +peekmore = "0.5.1" +wasm-bindgen = { version = "0.2.63", optional = true } beef = "0.4.4" # criterion is not a dev-dependency because it makes tests take too # long to compile, and you cannot make dev-dependencies optional @@ -76,8 +76,8 @@ profiling = [] bench = ["criterion"] [dev-dependencies] -tempfile = "3" -paste = "0.1" +tempfile = "3.1.0" +paste = "0.1.17" [profile.release] debug = true diff --git a/src/parse/ident.rs b/src/parse/ident.rs index 793fe5c..b2adaff 100644 --- a/src/parse/ident.rs +++ b/src/parse/ident.rs @@ -66,7 +66,7 @@ impl<'a> Parser<'a> { let interpolation = self.parse_interpolation()?; buf.push_str(&interpolation.node.to_css_string(interpolation.span)?); } else { - self.toks.reset_view(); + self.toks.reset_cursor(); break; } } diff --git a/src/parse/mod.rs b/src/parse/mod.rs index bc5c1ea..bb69261 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -479,7 +479,7 @@ impl<'a> Parser<'a> { self.read_until_newline(); } _ => { - self.toks.reset_view(); + self.toks.reset_cursor(); return found_whitespace; } }, @@ -520,7 +520,7 @@ impl<'a> Parser<'a> { self.toks.peek_forward(1); let ident = peek_ident_no_interpolation(self.toks, false, pos)?; if ident.as_str() != "else" { - self.toks.reset_view(); + self.toks.reset_cursor(); break; } self.toks.take(4).for_each(drop); diff --git a/src/parse/style.rs b/src/parse/style.rs index 18c98ee..18dd5e1 100644 --- a/src/parse/style.rs +++ b/src/parse/style.rs @@ -49,11 +49,11 @@ impl<'a> Parser<'a> { while let Some(tok) = self.toks.peek() { match tok.kind { ';' | '}' => { - self.toks.reset_view(); + self.toks.reset_cursor(); break; } '{' => { - self.toks.reset_view(); + self.toks.reset_cursor(); return None; } '(' => { @@ -98,10 +98,10 @@ impl<'a> Parser<'a> { if let Some(first_char) = self.toks.peek() { if first_char.kind == '#' { if !matches!(self.toks.peek_forward(1), Some(Token { kind: '{', .. })) { - self.toks.reset_view(); + self.toks.reset_cursor(); return Ok(SelectorOrStyle::Selector(String::new())); } - self.toks.reset_view(); + self.toks.reset_cursor(); } else if !is_name_start(first_char.kind) && first_char.kind != '-' { return Ok(SelectorOrStyle::Selector(String::new())); } diff --git a/src/parse/value.rs b/src/parse/value.rs index b861d70..abc6a0d 100644 --- a/src/parse/value.rs +++ b/src/parse/value.rs @@ -382,10 +382,10 @@ impl<'a> Parser<'a> { '#' => { if let Some(Token { kind: '{', pos }) = self.toks.peek_forward(1) { self.span_before = *pos; - self.toks.reset_view(); + self.toks.reset_cursor(); return Some(self.parse_ident_value()); } - self.toks.reset_view(); + self.toks.reset_cursor(); self.toks.next(); let hex = match self.parse_hex() { Ok(v) => v, @@ -660,7 +660,7 @@ impl<'a> Parser<'a> { peek_counter += peek_whitespace(self.toks); while let Some(tok) = self.toks.peek() { let kind = tok.kind; - self.toks.move_forward(1); + self.toks.advance_cursor(); peek_counter += 1; if kind == '!' || kind == '%' @@ -673,7 +673,7 @@ impl<'a> Parser<'a> { buf.push_str(&self.peek_escape()?); } else if kind == '#' { if let Some(Token { kind: '{', .. }) = self.toks.peek() { - self.toks.move_forward(1); + self.toks.advance_cursor(); peek_counter += 1; let (interpolation, count) = self.peek_interpolation()?; peek_counter += count; @@ -705,14 +705,14 @@ impl<'a> Parser<'a> { break; } } - self.toks.reset_view(); + self.toks.reset_cursor(); Ok(None) } fn peek_interpolation(&mut self) -> SassResult<(Spanned, usize)> { let vec = peek_until_closing_curly_brace(self.toks)?; let peek_counter = vec.len(); - self.toks.move_forward(1); + self.toks.advance_cursor(); let val = self.parse_value_from_vec(vec)?; Ok(( Spanned { diff --git a/src/parse/variable.rs b/src/parse/variable.rs index e95e5a1..18b703d 100644 --- a/src/parse/variable.rs +++ b/src/parse/variable.rs @@ -171,7 +171,7 @@ impl<'a> Parser<'a> { default = true; } "important" => { - self.toks.reset_view(); + self.toks.reset_cursor(); val_toks.push(self.toks.next().unwrap()); continue; } diff --git a/src/selector/attribute.rs b/src/selector/attribute.rs index abac689..2646feb 100644 --- a/src/selector/attribute.rs +++ b/src/selector/attribute.rs @@ -46,14 +46,14 @@ fn attribute_name(parser: &mut Parser<'_>, start: Span) -> SassResult SelectorParser<'a, 'b> { match self.parser.toks.peek_forward(1) { Some(Token { kind, .. }) if is_name_start(*kind) || kind == &'-' || kind == &'\\' => { - self.parser.toks.reset_view(); + self.parser.toks.reset_cursor(); true } Some(..) | None => { - self.parser.toks.reset_view(); + self.parser.toks.reset_cursor(); false } } diff --git a/src/utils/number.rs b/src/utils/number.rs index 704982a..1394c32 100644 --- a/src/utils/number.rs +++ b/src/utils/number.rs @@ -106,7 +106,7 @@ pub(crate) fn eat_number>( break; } - toks.reset_view(); + toks.reset_cursor(); whole.push_str(&dec); diff --git a/src/utils/peek_until.rs b/src/utils/peek_until.rs index faa1039..9f5b307 100644 --- a/src/utils/peek_until.rs +++ b/src/utils/peek_until.rs @@ -15,13 +15,13 @@ pub(crate) fn peek_until_closing_curly_brace>( match tok.kind { q @ '"' | q @ '\'' => { t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); t.extend(peek_until_closing_quote(toks, q)?); } '{' => { nesting += 1; t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); } '}' => { if nesting == 0 { @@ -29,7 +29,7 @@ pub(crate) fn peek_until_closing_curly_brace>( } else { nesting -= 1; t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); } } '/' => { @@ -44,7 +44,7 @@ pub(crate) fn peek_until_closing_curly_brace>( } _ => { t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); } } } @@ -61,12 +61,12 @@ fn peek_until_closing_quote>( match tok.kind { '"' if q == '"' => { t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); break; } '\'' if q == '\'' => { t.push(tok); - toks.move_forward(1); + toks.advance_cursor(); break; } '\\' => { @@ -90,7 +90,7 @@ fn peek_until_closing_quote>( } _ => t.push(tok), } - toks.move_forward(1); + toks.advance_cursor(); } Ok(t) } @@ -100,7 +100,7 @@ fn peek_until_newline>(toks: &mut PeekMoreIterator) if tok.kind == '\n' { break; } - toks.move_forward(1); + toks.advance_cursor(); } } @@ -111,7 +111,7 @@ fn peek_whitespace, W: IsWhitespace>(s: &mut PeekMoreItera break; } found_whitespace = true; - s.move_forward(1); + s.advance_cursor(); } found_whitespace }