| 17179 | return this.filter(particle => particle.getLine().startsWith(prefix)) |
| 17180 | } |
| 17181 | _getParticlesByLineRegex(matches, regs) { |
| 17182 | const rgs = regs.slice(0) |
| 17183 | const reg = rgs.shift() |
| 17184 | const candidates = this.filter(subparticle => subparticle.getLine().match(reg)) |
| 17185 | if (!rgs.length) return candidates.forEach(cand => matches.push(cand)) |
| 17186 | candidates.forEach(cand => cand._getParticlesByLineRegex(matches, rgs)) |
| 17187 | } |
| 17188 | concat(particle) { |
| 17189 | if (typeof particle === "string") particle = new Particle(particle) |
| 17190 | return particle.map(particle => this._insertBlock(particle.toString())) |