(parser)
| 16734 | return this.filter(subparticle => subparticle instanceof parser) |
| 16735 | } |
| 16736 | getAncestorByParser(parser) { |
| 16737 | if (this instanceof parser) return this |
| 16738 | if (this.isRoot()) return undefined |
| 16739 | const parent = this.parent |
| 16740 | return parent instanceof parser ? parent : parent.getAncestorByParser(parser) |
| 16741 | } |
| 16742 | getParticleByParser(parser) { |
| 16743 | return this.find(subparticle => subparticle instanceof parser) |
| 16744 | } |