equal
deleted
inserted
replaced
85 if (next_x < stop) filled_gaps + new MarkupNode(base, next_x, stop, Nil, id, content, desc) |
85 if (next_x < stop) filled_gaps + new MarkupNode(base, next_x, stop, Nil, id, content, desc) |
86 else filled_gaps |
86 else filled_gaps |
87 } |
87 } |
88 } |
88 } |
89 |
89 |
|
90 def filter(p: (MarkupNode => Boolean)): List[MarkupNode] = { |
|
91 val filtered = children.flatMap(_.filter(p)) |
|
92 if (p(this)) List(this set_children(filtered)) |
|
93 else filtered |
|
94 } |
|
95 |
90 def +(new_child : MarkupNode) : MarkupNode = { |
96 def +(new_child : MarkupNode) : MarkupNode = { |
91 if (new_child fitting_into this) { |
97 if (new_child fitting_into this) { |
92 val new_children = children.map(c => if((new_child fitting_into c)) c + new_child else c) |
98 val new_children = children.map(c => if((new_child fitting_into c)) c + new_child else c) |
93 if (new_children == children) { |
99 if (new_children == children) { |
94 // new_child did not fit into children of this -> insert new_child between this and its children |
100 // new_child did not fit into children of this -> insert new_child between this and its children |