From 0c7e2017d5f3e6a1f540d746a138659741e44671 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sat, 8 Aug 2020 21:38:59 -0400 Subject: [PATCH] use patched version of peekmore --- Cargo.toml | 2 +- src/parse/args.rs | 1 + src/parse/mixin.rs | 1 + src/parse/value/css_function.rs | 9 ++------- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b16a8e3..5c6b841 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ num-traits = "0.2.12" once_cell = "1.4.0" rand = { version = "0.7.3", optional = true } codemap = "0.1.3" -peekmore = "0.5.2" +peekmore = { git = "https://github.com/connorskees/peekmore", branch = "queue-cursor-equal" } wasm-bindgen = { version = "0.2.65", optional = true } beef = "0.4.4" phf = { version = "0.8.0", features = ["macros"] } diff --git a/src/parse/args.rs b/src/parse/args.rs index ea22cc4..f484bc3 100644 --- a/src/parse/args.rs +++ b/src/parse/args.rs @@ -107,6 +107,7 @@ impl<'a> Parser<'a> { args.push(FuncArg { name: name.node.into(), + // todo: None if empty default: Some(default), is_variadic, }); diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs index 1278b57..9d8e0c6 100644 --- a/src/parse/mixin.rs +++ b/src/parse/mixin.rs @@ -131,6 +131,7 @@ impl<'a> Parser<'a> { None }; + // todo: self.consume_if_exists if let Some(Token { kind: ';', .. }) = self.toks.peek() { self.toks.next(); } diff --git a/src/parse/value/css_function.rs b/src/parse/value/css_function.rs index c74bd15..11cd2bf 100644 --- a/src/parse/value/css_function.rs +++ b/src/parse/value/css_function.rs @@ -102,18 +102,13 @@ impl<'a> Parser<'a> { } else if kind == ')' { buf.push(')'); self.toks.truncate_iterator_to_cursor(); - self.toks.next(); return Ok(Some(buf)); } else if kind.is_whitespace() { peek_whitespace(self.toks); - let next = match self.toks.peek() { - Some(v) => v, - None => break, - }; - if next.kind == ')' { + if let Some(Token { kind: ')', .. }) = self.toks.peek() { + self.toks.advance_cursor(); buf.push(')'); self.toks.truncate_iterator_to_cursor(); - self.toks.next(); return Ok(Some(buf)); } else { break;