Skip to content

Commit

Permalink
change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopedraza committed Jan 20, 2025
1 parent 70ca888 commit fbf42a8
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@ impl<T: Iterator<Item = Result<Token, Error>>> Parser<T> {
}

self.ignoring_whitespace(|parser| {
let res = parser.expression(Precedence::Lowest)?;
let first_exp = parser.expression(Precedence::Lowest)?;

match parser.next_token()? {
Some(TokenType::Rparen) => Ok(res),
Some(TokenType::Rparen) => Ok(first_exp),
Some(TokenType::Comma) => parser
.sequence(TokenType::Rparen, Some(res))
.sequence(TokenType::Rparen, Some(first_exp))
.map(|lst| tuple(lst, parser.start_to_cur(start))),
Some(tok) => {
parser.err_with_cur(ParserError::UnexpectedToken(vec![TokenType::Rparen], tok))
Expand Down Expand Up @@ -2126,4 +2126,25 @@ mod tests {
))),
);
}

#[test]
#[ignore = "not yet implemented"]
fn block_within_list() {
let code = unindent(
"
[
a ->
2
a
]
",
);

let lexer = lexer_from(&code);

assert_eq!(
Parser::from(lexer).next(),
Some(Ok(extension_list(vec![], pos(0, 22)))),
);
}
}

0 comments on commit fbf42a8

Please sign in to comment.