1
Fork 0

Remove bra/ket naming.

This is a naming convention used in a handful of spots in the parser for
delimiters. It confused me when I first saw it a long time ago, and I've
never liked it. A web search says "Bra-ket notation" exists in linear
algebra but the terminology has zero prior use in a programming context,
as far as I can tell.

This commit changes it to `open`/`close`, which is consistent with the
rest of the compiler.
This commit is contained in:
Nicholas Nethercote 2024-12-04 15:50:46 +11:00
parent fb5ba8a6d4
commit d5370d981f
2 changed files with 24 additions and 24 deletions

View file

@ -1125,11 +1125,11 @@ impl<'a> Parser<'a> {
Ok(self.mk_expr_err(lo.to(self.token.span), guar))
}
/// Eats and discards tokens until one of `kets` is encountered. Respects token trees,
/// Eats and discards tokens until one of `closes` is encountered. Respects token trees,
/// passes through any errors encountered. Used for error recovery.
pub(super) fn eat_to_tokens(&mut self, kets: &[&TokenKind]) {
if let Err(err) =
self.parse_seq_to_before_tokens(kets, &[], SeqSep::none(), |p| Ok(p.parse_token_tree()))
pub(super) fn eat_to_tokens(&mut self, closes: &[&TokenKind]) {
if let Err(err) = self
.parse_seq_to_before_tokens(closes, &[], SeqSep::none(), |p| Ok(p.parse_token_tree()))
{
err.cancel();
}