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
// Get the most recently added non-paren node
for node := outQueue[idx]; idx >= 0 && (node.nodetype == RPAREN || node.nodetype == LPAREN); node = outQueue[idx] {
idx--
}
if idx < 0 {
// Get the last added node
if idx < 0 || outQueue[idx].nodetype == LPAREN {
panic("Numeric specifier with no content.")
}
outQueue[idx].startReps = startRangeNum

Loading…
Cancel
Save