feat: initial parallel type-checker implementation

This commit is contained in:
2025-03-14 04:09:34 +00:00
parent 42515abf2a
commit 53d47fda63
5 changed files with 322 additions and 283 deletions

View File

@@ -1,5 +1,7 @@
package wacc
import cats.data.Chain
object microWacc {
import wacc.types._
@@ -78,12 +80,12 @@ object microWacc {
}
case class Assign(lhs: LValue, rhs: Expr) extends Stmt
case class If(cond: Expr, thenBranch: List[Stmt], elseBranch: List[Stmt]) extends Stmt
case class While(cond: Expr, body: List[Stmt]) extends Stmt
case class If(cond: Expr, thenBranch: Chain[Stmt], elseBranch: Chain[Stmt]) extends Stmt
case class While(cond: Expr, body: Chain[Stmt]) extends Stmt
case class Call(target: CallTarget, args: List[Expr]) extends Stmt with Expr(target.retTy)
case class Return(expr: Expr) extends Stmt
// Program
case class FuncDecl(name: Ident, params: List[Ident], body: List[Stmt])
case class Program(funcs: List[FuncDecl], stmts: List[Stmt])
case class FuncDecl(name: Ident, params: List[Ident], body: Chain[Stmt])
case class Program(funcs: Chain[FuncDecl], stmts: Chain[Stmt])
}