diff -r 7af2eea19646 -r bb54e7aa1a3f solutions/cw3/parser.sc --- a/solutions/cw3/parser.sc Tue Sep 19 09:54:41 2023 +0100 +++ b/solutions/cw3/parser.sc Tue Sep 19 12:56:10 2023 +0100 @@ -245,7 +245,7 @@ def eval(bl: Block) : Env = eval_bl(bl, Map()) @main -def main(file: String) = { +def run(file: String) = { val contents = os.read(os.pwd / file) println(s"Lex $file: ") println(tokenise(contents)) @@ -255,6 +255,15 @@ println(eval(Stmts.parse_all(tokenise(contents)).head)) } +@main +def test(file: String) = { + val contents = os.read(os.pwd / file) + println(s"Lex $file: ") + println(tokenise(contents)) + println(s"Parse $file: ") + println(Stmts.parse_all(tokenise(contents)).head) +} + /* println("Loops eval") val start = System.nanoTime()