Fixed bug where a repeated capturing group eg. (a){3} wouldn't capture only the last iteration, like it should

master
Aadhavan Srinivasan 6 days ago
parent 93a5e24c8d
commit 8d6e1a41a5

@ -382,11 +382,8 @@ func shuntingYard(re string) []postfixNode {
} }
idx := len(outQueue) - 1 idx := len(outQueue) - 1
// Get the most recently added non-paren node // Get the last added node
for node := outQueue[idx]; idx >= 0 && (node.nodetype == RPAREN || node.nodetype == LPAREN); node = outQueue[idx] { if idx < 0 || outQueue[idx].nodetype == LPAREN {
idx--
}
if idx < 0 {
panic("Numeric specifier with no content.") panic("Numeric specifier with no content.")
} }
outQueue[idx].startReps = startRangeNum outQueue[idx].startReps = startRangeNum

Loading…
Cancel
Save