changeset 936 | 0b5f06539a84 |
parent 846 | 3a535de22816 |
child 943 | 5365ef60707e |
--- a/progs/lexer/lexer.sc Sun Oct 01 15:25:22 2023 +0100 +++ b/progs/lexer/lexer.sc Mon Oct 02 23:10:56 2023 +0100 @@ -42,13 +42,13 @@ implicit def string2rexp(s : String) : Rexp = charlist2rexp(s.toList) -implicit def RexpOps(r: Rexp) = new { +extension (r: Rexp) { def | (s: Rexp) = ALT(r, s) def % = STAR(r) def ~ (s: Rexp) = SEQ(r, s) } -implicit def stringOps(s: String) = new { +extension (s: String) { def | (r: Rexp) = ALT(s, r) def | (r: String) = ALT(s, r) def % = STAR(s)