feat: renamer maybe maybe maybe maybe

This commit is contained in:
2025-02-04 22:26:38 +00:00
parent 5f7a89b47f
commit 06c8a069fb
5 changed files with 181 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
package wacc
import scala.collection.mutable
import parsley.{Failure, Success}
import scopt.OParser
import java.io.File
@@ -32,8 +33,15 @@ val cliParser = {
def compile(contents: String): Int = {
parser.parse(contents) match {
case Success(ast) =>
// TODO: Do semantics things
0
given errors: mutable.Builder[Error, List[Error]] = List.newBuilder
val names = renamer.rename(ast)
// given ctx: types.TypeCheckerCtx[List[Error]] =
// types.TypeCheckerCtx(names, errors)
// types.check(ast)
if (errors.result.nonEmpty) {
errors.result.foreach(println)
200
} else 0
case Failure(msg) =>
println(msg)
100