changeset 936 | 0b5f06539a84 |
parent 852 | 8706b846a3e0 |
child 948 | 6bb67c2dcfd3 |
--- a/progs/lexer/lex.sc Sun Oct 01 15:25:22 2023 +0100 +++ b/progs/lexer/lex.sc Mon Oct 02 23:10:56 2023 +0100 @@ -40,13 +40,13 @@ val HELLO : Rexp = "hello" -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)