mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-02 11:52:28 +03:00
OnigRegExp.getCaptureTree does not include empty child captures
This commit is contained in:
parent
a85345e392
commit
6878d19a6a
@ -9,7 +9,8 @@ OnigRegExp.prototype.getCaptureTree = (string, startPosition) ->
|
|||||||
|
|
||||||
childCaptures = []
|
childCaptures = []
|
||||||
while startPositions[0] < endPosition
|
while startPositions[0] < endPosition
|
||||||
childCaptures.push(buildCaptureTree(captures, startPositions, totalCaptures))
|
subtree = buildCaptureTree(captures, startPositions, totalCaptures)
|
||||||
|
childCaptures.push(subtree) if subtree.text.length
|
||||||
|
|
||||||
tree.captures = childCaptures if childCaptures.length
|
tree.captures = childCaptures if childCaptures.length
|
||||||
tree
|
tree
|
||||||
|
Loading…
Reference in New Issue
Block a user