Skip to content

Commit

Permalink
chore: allow parenthesizing in two type locations (#2388)
Browse files Browse the repository at this point in the history
  • Loading branch information
kek kek kek authored Aug 21, 2023
1 parent 86f1c7e commit 5d72d4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/noirc_frontend/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@ fn type_expression() -> impl NoirParser<UnresolvedTypeExpression> {
recursive(|expr| {
expression_with_precedence(
Precedence::lowest_type_precedence(),
nothing(),
expr,
nothing(),
true,
false,
)
Expand Down Expand Up @@ -1645,6 +1645,11 @@ mod test {
);
}

#[test]
fn parse_type_expression() {
parse_all(type_expression(), vec!["(123)", "123", "(1 + 1)", "(1 + (1))"]);
}

#[test]
fn parse_array_sugar() {
let valid = vec!["[0;7]", "[(1, 2); 4]", "[0;Four]", "[2;1+3-a]"];
Expand Down

0 comments on commit 5d72d4d

Please sign in to comment.