Repository: HigherOrderCO/Bend
File: src/fun/parser.rs (Rust)

Code before:
      // Let
      if self.try_consume_keyword("let") {
        unexpected_tag(self)?;
        let pat = self.parse_pattern(true)?;
        self.consume("=")?;
        let val = self.parse_term()?;
        self.try_consume(";");
        let nxt = self.parse_term()?;
        return Ok(Term::Let { pat: Box::new(pat), val: Box::new(val), nxt: Box::new(nxt) });
      }

      // If
      if self.try_consume_keyword("if") {
        let cnd = self.parse_term()?;
        self.consume("{")?;
        let thn = self.parse_term()?;
        self.consume("}")?;
        self.consume("else")?;
        self.consume("{")?;
        let els = self.parse_term()?;
        self.consume("}")?;
        return Ok(Term::Swt {
          arg: Box::new(cnd),
          bnd: Some(Name::new("%cond")),
          with: Vec::new(),
          pred: Some(Name::new("%cond")),
          arms: vec![els, thn],
        });
      }

      // Match
      if self.try_consume_keyword("match") {
        unexpected_tag(self)?;
        let (bnd, arg, with) = self.parse_match_arg()?;
        let arms = self.list_like(|p| p.parse_match_arm(), "{", "}", ";", false, 1)?;
        return Ok(Term::Mat { arg: Box::new(arg), bnd: Some(bnd), with, arms });
      }

      // Switch
      if self.try_consume_keyword("switch") {
        unexpected_tag(self)?;
        return self.parse_switch();
      }

      // Do
      if self.try_consume_keyword("do") {
        unexpected_tag(self)?;
        let typ = self.parse_name()?;
        self.consume("{")?;
        let ask = self.parse_ask(Name::new(typ))?;
        self.consume("}")?;

Review comment (suggestion):
```suggestion
          pred: Some(Name::new("%cond-1")),
```

Code after:
      // Let
      if self.try_consume_keyword("let") {
        unexpected_tag(self)?;
        let pat = self.parse_pattern(true)?;
        self.consume("=")?;
        let val = self.parse_term()?;
        self.try_consume(";");
        let nxt = self.parse_term()?;
        return Ok(Term::Let { pat: Box::new(pat), val: Box::new(val), nxt: Box::new(nxt) });
      }

      // If
      if self.try_consume_keyword("if") {
        let cnd = self.parse_term()?;
        self.consume("{")?;
        let thn = self.parse_term()?;
        self.consume("}")?;
        self.consume("else")?;
        self.consume("{")?;
        let els = self.parse_term()?;
        self.consume("}")?;
        return Ok(Term::Swt {
          arg: Box::new(cnd),
          bnd: Some(Name::new("%cond")),
          with: Vec::new(),
          pred: Some(Name::new("%cond-1")),
          arms: vec![els, thn],
        });
      }

      // Match
      if self.try_consume_keyword("match") {
        unexpected_tag(self)?;
        let (bnd, arg, with) = self.parse_match_arg()?;
        let arms = self.list_like(|p| p.parse_match_arm(), "{", "}", ";", false, 1)?;
        return Ok(Term::Mat { arg: Box::new(arg), bnd: Some(bnd), with, arms });
      }

      // Switch
      if self.try_consume_keyword("switch") {
        unexpected_tag(self)?;
        return self.parse_switch();
      }

      // Do
      if self.try_consume_keyword("do") {
        unexpected_tag(self)?;
        let typ = self.parse_name()?;
        self.consume("{")?;
        let ask = self.parse_ask(Name::new(typ))?;
        self.consume("}")?;