This commit is contained in:
ConnorSkees 2020-01-25 13:25:38 -05:00
parent b0e1826449
commit a3c668ae83
2 changed files with 5 additions and 7 deletions

View File

@ -639,7 +639,7 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
fn eat_interpolation<I: Iterator<Item = Token>>(toks: &mut Peekable<I>) -> Vec<Token> {
let mut vals = Vec::new();
let mut n = 0;
while let Some(tok) = toks.next() {
for tok in toks {
match tok.kind {
TokenKind::Symbol(Symbol::OpenCurlyBrace) => n += 1,
TokenKind::Symbol(Symbol::CloseCurlyBrace) => n -= 1,

View File

@ -271,9 +271,8 @@ impl Value {
TokenKind::Symbol(Symbol::DoubleQuote) => {
let mut s = String::new();
while let Some(tok) = toks.next() {
match tok.kind {
TokenKind::Symbol(Symbol::DoubleQuote) => break,
_ => {}
if tok.kind == TokenKind::Symbol(Symbol::DoubleQuote) {
break;
}
s.push_str(&tok.kind.to_string());
}
@ -282,9 +281,8 @@ impl Value {
TokenKind::Symbol(Symbol::SingleQuote) => {
let mut s = String::new();
while let Some(tok) = toks.next() {
match tok.kind {
TokenKind::Symbol(Symbol::SingleQuote) => break,
_ => {}
if tok.kind == TokenKind::Symbol(Symbol::SingleQuote) {
break;
}
s.push_str(&tok.kind.to_string());
}