solutions/cw3/lexer.sc
changeset 959 64ec1884d860
parent 920 7af2eea19646
child 961 c0600f8b6427
--- a/solutions/cw3/lexer.sc	Sat Dec 02 21:37:04 2023 +0000
+++ b/solutions/cw3/lexer.sc	Wed Feb 21 09:14:12 2024 +0000
@@ -233,7 +233,7 @@
 }
 
 def escape(tks: List[(String, String)]) =
-  tks.map{ case (s1, s2) => (s1, esc(s2))}
+  tks.map{ case (s1, s2) => (esc(s1), esc(s2))}
 
 
 // Tokens
@@ -257,5 +257,11 @@
 }
 
 // Tokenise
-def tokenise(s: String) : List[Token] = 
-  lexing_simp(WHILE_REGS, s).collect(token)
+def tokenise(s: String) = //: List[Token] = 
+  escape(lexing_simp(WHILE_REGS, s)).filter{p => p._1 != "\"w\""}//.collect(token)
+
+
+
+
+println(tokenise(os.read(os.pwd / "primes.while")))
+