Skip to content

Commit 9b052ed

Browse files
committed
A prettier interpreter
1 parent ede2421 commit 9b052ed

File tree

14 files changed

+749
-874
lines changed

14 files changed

+749
-874
lines changed

compiler/shared/main/scala/mlscript/compiler/ir/Builder.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,12 +673,12 @@ final class Builder(fresh: Fresh, fnUid: FreshInt, classUid: FreshInt, tag: Fres
673673
NuTypeDef(Mod,TypeName("True"),List(),None,None,None,List(),None,None,TypingUnit(List()))(N, N, Nil) ::
674674
NuTypeDef(Mod,TypeName("False"),List(),None,None,None,List(),None,None,TypingUnit(List()))(N, N, Nil) ::
675675
NuTypeDef(Mod,TypeName("Callable"),List(),None,None,None,List(),None,None,TypingUnit(List(
676-
NuFunDef(N, Var("apply0"), None, Nil, L(Lam(Tup((0 to 0).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
677-
NuFunDef(N, Var("apply1"), None, Nil, L(Lam(Tup((0 to 1).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
678-
NuFunDef(N, Var("apply2"), None, Nil, L(Lam(Tup((0 to 2).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
679-
NuFunDef(N, Var("apply3"), None, Nil, L(Lam(Tup((0 to 3).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
680-
NuFunDef(N, Var("apply4"), None, Nil, L(Lam(Tup((0 to 4).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
681-
NuFunDef(N, Var("apply5"), None, Nil, L(Lam(Tup((0 to 5).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
676+
NuFunDef(N, Var("apply0"), None, Nil, L(Lam(Tup((0 until 0).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
677+
NuFunDef(N, Var("apply1"), None, Nil, L(Lam(Tup((0 until 1).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
678+
NuFunDef(N, Var("apply2"), None, Nil, L(Lam(Tup((0 until 2).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
679+
NuFunDef(N, Var("apply3"), None, Nil, L(Lam(Tup((0 until 3).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
680+
NuFunDef(N, Var("apply4"), None, Nil, L(Lam(Tup((0 until 4).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
681+
NuFunDef(N, Var("apply5"), None, Nil, L(Lam(Tup((0 until 5).map(x => None -> Fld(FldFlags.empty, Var("x" + x.toString()))).toList), IntLit(0))))(N, N, N, N, N, false, Nil),
682682
)))(N, N, Nil) ::
683683
NuTypeDef(Mod,TypeName("List"),List(),None,None,None,List(),None,None,TypingUnit(List()))(N, N, Nil) ::
684684
NuTypeDef(Cls,TypeName("Cons"),List(),Some(Tup(List((None,Fld(FldFlags.empty,Var("h"))), (None,Fld(FldFlags.empty,Var("t")))))),None,None,List(Var("List")),None,None,TypingUnit(List()))(N, N, Nil) ::

compiler/shared/main/scala/mlscript/compiler/ir/IR.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private def showArguments(args: Ls[TrivialExpr]) = args map (_.show) mkString ",
117117
enum Expr:
118118
case Ref(name: Name) extends Expr, TrivialExpr
119119
case Literal(lit: Lit) extends Expr, TrivialExpr
120-
case CtorApp(name: ClassRef, args: Ls[TrivialExpr])
120+
case CtorApp(cls: ClassRef, args: Ls[TrivialExpr])
121121
case Select(name: Name, cls: ClassRef, field: Str)
122122
case BasicOp(name: Str, args: Ls[TrivialExpr])
123123

0 commit comments

Comments
 (0)