feat: renamer maybe maybe maybe maybe
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user