fix: fix merge breaks, add function names to scope before renaming bodies

This commit is contained in:
2025-02-05 20:41:49 +00:00
parent 6027bea95e
commit 0f18bca7fd
4 changed files with 35 additions and 34 deletions

View File

@@ -27,10 +27,10 @@ object ast {
case class StrLiter(v: String)(pos: Position) extends Expr6
object StrLiter extends ParserBridgePos1[String, StrLiter]
case class PairLiter()(pos: Position) extends Expr6
object PairLiter extends Expr6 with ParserBridgePos0[PairLiter]
case class Ident(v: String, var uid: Int = -1) extends Expr6 with LValue
object PairLiter extends ParserBridgePos0[PairLiter]
case class Ident(v: String, var uid: Int = -1)(pos: Position) extends Expr6 with LValue
object Ident extends ParserBridgePos1[String, Ident] {
def apply(x1: String): Ident = new Ident(x1)
def apply(v: String)(pos: Position): Ident = new Ident(v)(pos)
}
case class ArrayElem(name: Ident, indices: NonEmptyList[Expr])(pos: Position)
extends Expr6
@@ -46,18 +46,15 @@ object ast {
sealed trait UnaryOp extends Expr {
val x: Expr
}
sealed trait UnaryOp extends Expr {
val x: Expr
}
case class Negate(x: Expr6)(pos: Position) extends Expr6 with UnaryOp with UnaryOp
case class Negate(x: Expr6)(pos: Position) extends Expr6 with UnaryOp
object Negate extends ParserBridgePos1[Expr6, Negate]
case class Not(x: Expr6)(pos: Position) extends Expr6 with UnaryOp with UnaryOp
case class Not(x: Expr6)(pos: Position) extends Expr6 with UnaryOp
object Not extends ParserBridgePos1[Expr6, Not]
case class Len(x: Expr6)(pos: Position) extends Expr6 with UnaryOp with UnaryOp
case class Len(x: Expr6)(pos: Position) extends Expr6 with UnaryOp
object Len extends ParserBridgePos1[Expr6, Len]
case class Ord(x: Expr6)(pos: Position) extends Expr6 with UnaryOp with UnaryOp
case class Ord(x: Expr6)(pos: Position) extends Expr6 with UnaryOp
object Ord extends ParserBridgePos1[Expr6, Ord]
case class Chr(x: Expr6)(pos: Position) extends Expr6 with UnaryOp with UnaryOp
case class Chr(x: Expr6)(pos: Position) extends Expr6 with UnaryOp
object Chr extends ParserBridgePos1[Expr6, Chr]
// Binary operators