Remove =x uses from ISLE, and remove support from the DSL compiler. (#4078)

This is a follow-up on #4074: now that we have the simplified syntax, we
can remove the old, redundant syntax.
This commit is contained in:
Chris Fallin
2022-04-28 11:17:08 -07:00
committed by GitHub
parent 477d394288
commit eceb433b28
8 changed files with 78 additions and 89 deletions

View File

@@ -411,23 +411,13 @@ impl<'a> Parser<'a> {
Ok(Pattern::Wildcard { pos })
} else if self.is_sym() {
let s = self.symbol()?;
if s.starts_with("=") {
// Deprecated `=x` syntax. This will go away once we
// change all uses to just `x`, which we can do
// because we disambiguate whether a mention of `x` is
// a binding or a matching of the already-bound value.
let s = &s[1..];
let var = self.str_to_ident(pos, s)?;
Ok(Pattern::Var { var, pos })
let var = self.str_to_ident(pos, &s)?;
if self.is_at() {
self.at()?;
let subpat = Box::new(self.parse_pattern()?);
Ok(Pattern::BindPattern { var, subpat, pos })
} else {
let var = self.str_to_ident(pos, &s)?;
if self.is_at() {
self.at()?;
let subpat = Box::new(self.parse_pattern()?);
Ok(Pattern::BindPattern { var, subpat, pos })
} else {
Ok(Pattern::Var { var, pos })
}
Ok(Pattern::Var { var, pos })
}
} else if self.is_lparen() {
self.lparen()?;