Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Feb 1, 2025
1 parent ff16e74 commit 9e65920
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions products/Particle.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ParserPool {
}
return obj
}
_getMatchingParser(line, contextParticle, atomBreakSymbol = TN_WORD_BREAK_SYMBOL) {
_getMatchingParser(line, contextParticle, lineNumber, atomBreakSymbol = TN_WORD_BREAK_SYMBOL) {
return this._getCueMap().get(this._getCue(line, atomBreakSymbol)) || this._getParserFromRegexTests(line) || this._getCatchAllParser(contextParticle)
}
_getCatchAllParser(contextParticle) {
Expand Down Expand Up @@ -1435,7 +1435,7 @@ class Particle extends AbstractParticle {
this._insertLineAndSubparticles(line, subparticles)
}
_insertLineAndSubparticles(line, subparticles, index = this.length) {
const parser = this._getParserPool()._getMatchingParser(line, this)
const parser = this._getParserPool()._getMatchingParser(line, this, index)
const newParticle = new parser(subparticles, line, this)
const adjustedIndex = index < 0 ? this.length + index : index
this._getSubparticlesArray().splice(adjustedIndex, 0, newParticle)
Expand Down Expand Up @@ -1474,9 +1474,10 @@ class Particle extends AbstractParticle {
}
const lineContent = line.substr(currentIndentCount)
const parent = parentStack[parentStack.length - 1]
const parser = parent._getParserPool()._getMatchingParser(lineContent, parent)
const subparticles = parent._getSubparticlesArray()
const parser = parent._getParserPool()._getMatchingParser(lineContent, parent, subparticles.length)
lastParticle = new parser(undefined, lineContent, parent)
parent._getSubparticlesArray().push(lastParticle)
subparticles.push(lastParticle)
})
}
_getCueIndex() {
Expand Down
9 changes: 5 additions & 4 deletions products/Particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ParserPool {
}
return obj
}
_getMatchingParser(line, contextParticle, atomBreakSymbol = TN_WORD_BREAK_SYMBOL) {
_getMatchingParser(line, contextParticle, lineNumber, atomBreakSymbol = TN_WORD_BREAK_SYMBOL) {
return this._getCueMap().get(this._getCue(line, atomBreakSymbol)) || this._getParserFromRegexTests(line) || this._getCatchAllParser(contextParticle)
}
_getCatchAllParser(contextParticle) {
Expand Down Expand Up @@ -1425,7 +1425,7 @@ class Particle extends AbstractParticle {
this._insertLineAndSubparticles(line, subparticles)
}
_insertLineAndSubparticles(line, subparticles, index = this.length) {
const parser = this._getParserPool()._getMatchingParser(line, this)
const parser = this._getParserPool()._getMatchingParser(line, this, index)
const newParticle = new parser(subparticles, line, this)
const adjustedIndex = index < 0 ? this.length + index : index
this._getSubparticlesArray().splice(adjustedIndex, 0, newParticle)
Expand Down Expand Up @@ -1464,9 +1464,10 @@ class Particle extends AbstractParticle {
}
const lineContent = line.substr(currentIndentCount)
const parent = parentStack[parentStack.length - 1]
const parser = parent._getParserPool()._getMatchingParser(lineContent, parent)
const subparticles = parent._getSubparticlesArray()
const parser = parent._getParserPool()._getMatchingParser(lineContent, parent, subparticles.length)
lastParticle = new parser(undefined, lineContent, parent)
parent._getSubparticlesArray().push(lastParticle)
subparticles.push(lastParticle)
})
}
_getCueIndex() {
Expand Down

0 comments on commit 9e65920

Please sign in to comment.