Closed eropsergeev closed 4 years ago
Lamac's output: "Fatal error: exception File "X86.ml", line 663, characters 17-22: Pattern matching failed" Code: `import List;
fun compileExpr (expr) { case expr of Binop(op, e1, e2) -> compileExpr(e1) +++ compileExpr(e2) +++ singleton(Binop(op)) | Var(x) -> singleton(Ld(x)) | Const(x) -> singleton(Const(x)) esac; failure("Unsupported erpression\n") }
public fun compileSM (stmt) { case stmt of Seq(stmt1, stmt2) -> compileSM(stmt1) +++ compileSM(stmt2) | Read(x) -> {Read, St(x)} | Write(x) -> {Ld(x), Write} | Assn(x, e) -> compileExpr(e) +++ singleton(St(x)) esac; failure("Unsupported statement\n") }`
Fixed in d06d9a250.
Lamac's output: "Fatal error: exception File "X86.ml", line 663, characters 17-22: Pattern matching failed" Code: `import List;
fun compileExpr (expr) { case expr of Binop(op, e1, e2) -> compileExpr(e1) +++ compileExpr(e2) +++ singleton(Binop(op)) | Var(x) -> singleton(Ld(x)) | Const(x) -> singleton(Const(x)) esac; failure("Unsupported erpression\n") }
public fun compileSM (stmt) { case stmt of Seq(stmt1, stmt2) -> compileSM(stmt1) +++ compileSM(stmt2) | Read(x) -> {Read, St(x)} | Write(x) -> {Ld(x), Write} | Assn(x, e) -> compileExpr(e) +++ singleton(St(x)) esac; failure("Unsupported statement\n") }`