Skip to content

Commit dd6b53d

Browse files
paulpadriaanm
authored andcommitted
Another big REPL patch.
a proper commit message, I will just say it adds a couple of pretty frabjous features, in addition to cleaning up a whole bunch of questionable code. * Tab-completion now chains through intermediate results on fields and 0-arg methods * You can now define custom Completors which define their own contents. Details and demos to come in a wiki document about the repl.
1 parent 75823c6 commit dd6b53d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/library/scala/xml/NodeSeq.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ abstract class NodeSeq extends immutable.Seq[Node] with SeqLike[Node, NodeSeq] {
8080
* @return ...
8181
*/
8282
def \(that: String): NodeSeq = {
83+
def fail = throw new IllegalArgumentException(that)
8384
def atResult = {
84-
def fail = throw new IllegalArgumentException(that)
8585
lazy val y = this(0)
8686
val attr =
8787
if (that.length == 1) fail
@@ -104,6 +104,7 @@ abstract class NodeSeq extends immutable.Seq[Node] with SeqLike[Node, NodeSeq] {
104104
NodeSeq fromSeq (this flatMap (_.child) filter cond)
105105

106106
that match {
107+
case "" => fail
107108
case "_" => makeSeq(!_.isAtom)
108109
case _ if (that(0) == '@' && this.length == 1) => atResult
109110
case _ => makeSeq(_.label == that)

0 commit comments

Comments
 (0)