Skip to content

Commit c05b439

Browse files
committed
Use ObjBody for pretty printing
1 parent 15e0dd7 commit c05b439

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

hkmc2/shared/src/main/scala/hkmc2/semantics/Elaborator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extends Importer:
9292
fieldOrVarSym(Handler, id)
9393
val newCtx = ctx.copy(locals = ctx.locals + (id.name -> sym))
9494
Term.Blk(
95-
Term.Handle(sym, term(cls)(using newCtx), block(sts)._1) :: Nil,
95+
Term.Handle(sym, term(cls)(using newCtx), ObjBody(block(sts)._1)) :: Nil,
9696
term(body)(using newCtx)
9797
)
9898

hkmc2/shared/src/main/scala/hkmc2/semantics/Term.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum Term extends Statement:
3434
case Deref(ref: Term)
3535
case Ret(result: Term)
3636
case Try(body: Term, finallyDo: Term)
37-
case Handle(lhs: LocalSymbol, rhs: Term, defs: Term.Blk)
37+
case Handle(lhs: LocalSymbol, rhs: Term, defs: ObjBody)
3838

3939
var symbol: Opt[Symbol] = N
4040

@@ -121,7 +121,7 @@ sealed trait Statement extends AutoLocated:
121121
td.rhs.toList
122122
case Import(sym, pth) => Nil
123123
case Try(body, finallyDo) => body :: finallyDo :: Nil
124-
case Handle(lhs, rhs, defs) => rhs :: defs :: Nil
124+
case Handle(lhs, rhs, defs) => rhs :: defs._1 :: Nil
125125

126126
protected def children: Ls[Located] = this match
127127
case t: Lit => t.lit.asTree :: Nil

hkmc2/shared/src/test/mlscript/parser/Handler.mls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ in
7979
//│ Handle:
8080
//│ lhs = globalThis:block#5.h
8181
//│ rhs = Ref of class:Eff
82-
//│ defs = Blk:
82+
//│ defs = ObjBody of Blk:
8383
//│ stats = Ls of
8484
//│ TermDefinition:
8585
//│ k = Fun

0 commit comments

Comments
 (0)