# Exclusive range pattern

fn classify(value: u8) { match value { 0..10 => {}, _ => {} } }

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList(Parameter(BoundIdentifier, TypeIdentifier)),
    Block(
      ExpressionStatement(
        MatchExpression(
          match,
          Identifier,
          MatchBlock(MatchArm(RangePattern(Integer, Integer), Block), MatchArm(_, Block)))))))

# Exclusive range pattern with a path bound

const LIMIT: u8 = 10; fn classify(value: u8) { match value { 0..LIMIT => {}, _ => {} } }

==>

SourceFile(
  ConstItem(const, BoundIdentifier, TypeIdentifier, Integer),
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList(Parameter(BoundIdentifier, TypeIdentifier)),
    Block(
      ExpressionStatement(
        MatchExpression(
          match,
          Identifier,
          MatchBlock(MatchArm(RangePattern(Integer, Identifier), Block), MatchArm(_, Block)))))))

# Upper-bounded exclusive range pattern

fn classify(value: u8) { match value { ..10 => {}, _ => {} } }

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList(Parameter(BoundIdentifier, TypeIdentifier)),
    Block(
      ExpressionStatement(
        MatchExpression(
          match,
          Identifier,
          MatchBlock(MatchArm(RangePattern(Integer), Block), MatchArm(_, Block)))))))

# Upper-bounded inclusive range pattern

fn classify(value: u8) { match value { ..=10 => {}, _ => {} } }

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList(Parameter(BoundIdentifier, TypeIdentifier)),
    Block(
      ExpressionStatement(
        MatchExpression(
          match,
          Identifier,
          MatchBlock(MatchArm(RangePattern(Integer), Block), MatchArm(_, Block)))))))

# Exclusive range pattern in an if let condition

fn classify(value: u8) { if let 0..10 = value {} }

==>

SourceFile(
  FunctionItem(
    fn,
    BoundIdentifier,
    ParamList(Parameter(BoundIdentifier, TypeIdentifier)),
    Block(
      ExpressionStatement(
        IfExpression(
          if,
          LetDeclaration(let, RangePattern(Integer, Integer), Identifier),
          Block)))))
