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
|
||||
// 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
|
||||
|
Reference in New Issue
Block a user