changeset 921 | bb54e7aa1a3f |
parent 920 | 7af2eea19646 |
--- a/solutions/cw2/lexer.sc Tue Sep 19 09:54:41 2023 +0100 +++ b/solutions/cw2/lexer.sc Tue Sep 19 12:56:10 2023 +0100 @@ -375,3 +375,20 @@ println(size(ders_simp("r".toList, WHILE_REGS))) println(size(ID)) println(size(ders_simp("read".toList, ID))) + + + +// for automated testing + +@main +def main(file: String) = { + // empty - nothing to run +} + +@main +def test(file: String) = { + val contents = os.read(os.pwd / file) + tokenise(contents) +} + +