Skip to content

Commit

Permalink
ast_analysis.c: Add assert for unreachable branch.
Browse files Browse the repository at this point in the history
Ranges using named endpoints are currently rejected with "Unsupported
operator".
  • Loading branch information
silentbicycle committed Jan 8, 2024
1 parent 16957a2 commit f5b1300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libre/ast_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ can_consume_single_newline(struct ast_expr *n)
return n->u.range.from.u.codepoint.u <= '\n'
&& n->u.range.to.u.codepoint.u >= '\n';
} else if (n->u.range.from.type == AST_ENDPOINT_NAMED) {
/* TODO: unreachable? */
/* currently unreachable, named ranges are unsupported */
assert(!"unreachable");
break;
}
break;
Expand Down

0 comments on commit f5b1300

Please sign in to comment.