use patched version of peekmore

This commit is contained in:
Connor Skees 2020-08-08 21:38:59 -04:00
parent fb785cf71c
commit 0c7e2017d5
4 changed files with 5 additions and 8 deletions

View File

@ -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"] }

View File

@ -107,6 +107,7 @@ impl<'a> Parser<'a> {
args.push(FuncArg {
name: name.node.into(),
// todo: None if empty
default: Some(default),
is_variadic,
});

View File

@ -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();
}

View File

@ -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;