mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-30 18:18:45 +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 = []
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user