Added function to return the number of subexpressions in the group

This commit is contained in:
2025-02-01 11:04:49 -05:00
parent fcdb23524a
commit 206fea34cd

View File

@@ -18,6 +18,12 @@ type Reg struct {
numGroups int
}
// numSubexp eturns the number of sub-expressions in the given [Reg]. This is equivalent
// to the number of capturing groups.
func (r Reg) NumSubexp() int {
return r.numGroups
}
const concatRune rune = 0xF0001
// Flags for shuntingYard - control its behavior