progs/lexer/lexer.sc
changeset 971 51e00f223792
parent 970 1d4659dd83fe
--- a/progs/lexer/lexer.sc	Fri Oct 18 05:59:04 2024 +0100
+++ b/progs/lexer/lexer.sc	Fri Oct 25 18:54:08 2024 +0100
@@ -43,9 +43,18 @@
 
 given Conversion[String, Rexp] = (s => charlist2rexp(s.toList))
 
+//extension (s: String) {
+//  def $ (r: Rexp) = RECD(s, r)
+//}
 extension (s: String) {
   def $ (r: Rexp) = RECD(s, r)
+  def | (r: Rexp) = ALT(s, r)
+  def | (r: String) = ALT(s, r)
+  def % = STAR(s)
+  def ~ (r: Rexp) = SEQ(s, r)
+  def ~ (r: String) = SEQ(s, r)
 }
+ 
 
 extension (r: Rexp) {
   def | (s: Rexp) = ALT(r, s)