-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite and adapt to Scala 3 features
- Loading branch information
1 parent
a79745e
commit 0540802
Showing
13 changed files
with
190 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package dotty.xml.interpolator | ||
package internal | ||
|
||
object Hole { | ||
object Hole: | ||
val HoleStart = 0xE000.toChar.toString | ||
val HoleChar = 0xE001.toChar.toString | ||
def encode(i: Int) = HoleStart + HoleChar * i | ||
} | ||
def encode(i: Int) = HoleStart + HoleChar * i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
src/main/scala/dotty/xml/interpolator/internal/Transform.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package dotty.xml.interpolator | ||
package internal | ||
|
||
import dotty.xml.interpolator.internal.Tree._ | ||
import Tree.* | ||
|
||
object Transform { | ||
def apply(nodes: Seq[Node]): Seq[Node] = { | ||
nodes.map { | ||
object Transform: | ||
|
||
def apply(nodes: Seq[Node]): Seq[Node] = | ||
nodes.map: | ||
case elem : Elem => | ||
val children = apply(elem.children) | ||
if (elem.name == "xml:group" && !elem.end.isEmpty) Group(elem.children).setPos(elem.pos) | ||
if elem.name == "xml:group" && !elem.end.isEmpty then Group(elem.children).setPos(elem.pos) | ||
else elem.copy(children = children).setPos(elem.pos) | ||
case node => node | ||
} | ||
} | ||
} | ||
end apply | ||
|
||
end Transform |
Oops, something went wrong.