@@ -15,7 +15,7 @@ object Code {
15
15
val m8 = new CodeMarker (" m8" )
16
16
17
17
implicit class CodeHelper (val sc : StringContext ) extends AnyVal {
18
- def code (args : Any * ): SourceWithPositions = {
18
+ def code (args : Embedded * ): SourceWithPositions = {
19
19
val pi = sc.parts.iterator
20
20
val ai = args.iterator
21
21
@@ -35,18 +35,14 @@ object Code {
35
35
scan(next)
36
36
37
37
ai.next() match {
38
- case emb : Embedded => emb match {
39
- case emb : CodeMarker =>
40
- positions += Tuple3 (emb, line, char)
41
-
42
- case emb : CodeInRange =>
43
- positions += Tuple3 (emb.range.start, line, char)
44
- scan(emb.text)
45
- stringBuilder.append(emb.text)
46
- positions += Tuple3 (emb.range.end, line, char)
47
-
48
- }
49
- case arg => throw new Exception (s " Interpolated code should be a ${classOf [Embedded ].getCanonicalName} but was " + arg)
38
+ case emb : CodeMarker =>
39
+ positions += Tuple3 (emb, line, char)
40
+
41
+ case emb : CodeInRange =>
42
+ positions += Tuple3 (emb.range.start, line, char)
43
+ scan(emb.text)
44
+ stringBuilder.append(emb.text)
45
+ positions += Tuple3 (emb.range.end, line, char)
50
46
}
51
47
52
48
}
0 commit comments