From 6878d19a6aff2a554fcadc03e6c56bf1e329262d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Aug 2012 18:27:39 -0600 Subject: [PATCH] OnigRegExp.getCaptureTree does not include empty child captures --- src/stdlib/onig-reg-exp.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdlib/onig-reg-exp.coffee b/src/stdlib/onig-reg-exp.coffee index 36407690f..42cc9960b 100644 --- a/src/stdlib/onig-reg-exp.coffee +++ b/src/stdlib/onig-reg-exp.coffee @@ -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