We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
p.capnamelist
1 parent 07e7dfa commit 197dfc9Copy full SHA for 197dfc9
syntax/parser.go
@@ -238,8 +238,8 @@ func (p *parser) noteCaptureName(name string, pos int) {
238
func (p *parser) assignNameSlots() {
239
if p.useMaintainCaptureOrder() {
240
p.capnames = p.capnamenums
241
- // Prepend `0` to capnamelist if it's not set
242
- if p.capnamelist[0] != `0` {
+ // Prepend `0` to capnamelist if it's not set (MaintainCaptureOrder was enabled inline)
+ if len(p.capnamelist) == 0 || p.capnamelist[0] != `0` {
243
p.capnamelist = append([]string{fmt.Sprint(0)}, p.capnamelist...)
244
}
245
} else {
0 commit comments