refactor: make microWacc.ArrayElem recursive rather than flat

This commit is contained in:
2025-02-26 18:08:30 +00:00
parent 62df2c2244
commit 85190ce174
2 changed files with 10 additions and 9 deletions

View File

@@ -1,7 +1,5 @@
package wacc
import cats.data.NonEmptyList
object microWacc {
import wacc.types._
@@ -19,9 +17,7 @@ object microWacc {
extends Expr(identTy)
with CallTarget(identTy)
with LValue
case class ArrayElem(value: LValue, indices: NonEmptyList[Expr])(ty: SemType)
extends Expr(ty)
with LValue
case class ArrayElem(value: LValue, index: Expr)(ty: SemType) extends Expr(ty) with LValue
// Operators
case class UnaryOp(x: Expr, op: UnaryOperator)(ty: SemType) extends Expr(ty)