@@ -52,7 +52,7 @@ class KList(protected[kore] val delegate: List[K])
5252 type This = KList
5353
5454 override def canEqual (that : Any ) = that.isInstanceOf [KList ]
55- override def newBuilder : Builder [K , KList ] = KList .newBuilder
55+ def newBuilder () : Builder [K , KList ] = KList .newBuilder(att)
5656
5757 def get (i : Int ) = delegate.lift(i)
5858 def att = Attributes ()
@@ -69,7 +69,7 @@ case class KApply(val klabel: KLabel, val klist: KList, val att: Attributes = At
6969
7070 def get (i : Int ) = klist.get(i)
7171
72- def newBuilder : Builder [K , KApply ] = klist.newBuilder mapResult { new KApply (klabel, _, att) }
72+ def newBuilder : Builder [K , KApply ] = klist.newBuilder() mapResult { new KApply (klabel, _, att) }
7373
7474 override def canEqual (that : Any ) = that match {
7575 case t : KApply => t.klabel == klabel
@@ -89,13 +89,13 @@ case class ConcreteKLabel(name: String) extends KLabel with KORE {
8989 def apply (ks : K * ) = new KApply (this , KList (ks))
9090}
9191
92- case class KSequence (val klist : KList , val att : Attributes = Attributes ())
92+ case class KSequence (val ks : List [ K ] , val att : Attributes = Attributes ())
9393 extends KAbstractCollection with KSequenceToString with KORE {
9494 type This = KSequence
95- def delegate = klist.delegate
95+ def delegate = ks
9696
97- def newBuilder : Builder [K , KSequence ] = klist .newBuilder mapResult { new KSequence (_, att) }
98- def copy (att : Attributes ): KSequence = new KSequence (klist , att)
97+ def newBuilder () : Builder [K , KSequence ] = KSequence .newBuilder( att)
98+ def copy (att : Attributes ): KSequence = new KSequence (ks , att)
9999
100100 def canEqual (that : Any ) = that.isInstanceOf [KSequence ]
101101}
@@ -124,9 +124,9 @@ case class KRewrite(left: K, right: K, att: Attributes = Attributes())
124124object KList extends CanBuildKCollection {
125125 type This = KList
126126
127- def apply (l : Iterable [K ]): KList = (newBuilder ++= l).result()
127+ def apply (l : Iterable [K ]): KList = (newBuilder() ++= l).result()
128128
129- def newBuilder : Builder [K , KList ] =
129+ def newBuilder ( att : Attributes = Attributes ()) : Builder [K , KList ] =
130130 new AssocBuilder [K , List [K ], KList ](ListBuffer ()) mapResult { new KList (_) }
131131
132132 def unapplySeq (l : KList ): Option [Seq [K ]] = Some (l.delegate.toSeq)
@@ -153,9 +153,9 @@ object KString extends Sort {
153153object KSequence extends CanBuildKCollection {
154154 type This = KSequence
155155
156- def newBuilder = KList .newBuilder mapResult { new KSequence (_, Attributes ()) }
157-
158- def fromJava ( l : Array [ K ]) = new KSequence (KList ( l : _* ), Attributes ())
156+ def newBuilder ( att : Attributes = Attributes ()) =
157+ new AssocBuilder [ K , List [ K ], KSequence ]( ListBuffer ())
158+ .mapResult { new KSequence (_, att) }
159159}
160160
161161object KRewrite {
@@ -166,7 +166,7 @@ object KRewrite {
166166}
167167
168168object EmptyK {
169- def apply () = KSequence (KList (), Attributes ())
169+ def apply () = KSequence (List (), Attributes ())
170170}
171171
172172object KLabel extends ConcreteKLabel (" KLabel" ) {
0 commit comments