Fixed bug where a repeated capturing group eg. (a){3} wouldn't capture only the last iteration, like it should
This commit is contained in:
7
main.go
7
main.go
@@ -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
|
||||||
|
Reference in New Issue
Block a user