Commit a4efac0c authored by Sapphie's avatar Sapphie
Browse files

Replace List by Seq

parent 952700cc
......@@ -209,25 +209,25 @@ object L3Parser {
(implicit p: Position): Tree = {
val name = freshName("anonFun")
val fn = Fun(name, args, body)
LetRec(List(fn), Ident(name))
LetRec(Seq(fn), Ident(name))
}
private def sLet_*(bdgs: Seq[(String,Tree)], body: Tree)
(implicit p: Position): Tree = {
bdgs.foldRight(body)((l, r) => {
Let(List(l), r)
Let(Seq(l), r)
})
}
private def sBegin(exprs: Seq[Tree])(implicit p: Position): Tree = {
exprs.reduceRight((l,r) => {
val anonName = freshName("t")
Let(List((anonName, l)), r)
Let(Seq((anonName, l)), r)
})
}
private def sRec(name: String, bdgs: Seq[(String, Tree)], body: Tree)
(implicit p: Position) = {
val (varNames, expressions) = bdgs.unzip
LetRec(
List(Fun(name, varNames, body)),
Seq(Fun(name, varNames, body)),
App(Ident(name), expressions)
)
}
......@@ -236,7 +236,7 @@ object L3Parser {
private def sOr(es: Seq[Tree])(implicit p: Position): Tree =
es.reduceRight((l, r) => {
val v = freshName("v")
Let(List((v, l)), If(Ident(v), Ident(v), r))
Let(Seq((v, l)), If(Ident(v), Ident(v), r))
})
private def sNot(e: Tree)(implicit p: Position): Tree =
If(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment