Fix TSS parsing multiple tags

This commit is contained in:
Sasha Koshka 2024-08-14 11:58:33 -04:00
parent 7da00e990e
commit 7c5de5a370

View File

@ -133,8 +133,8 @@ func (this *parser) parseSelector () (Selector, error) {
// tags // tags
err = this.ExpectNext(LBracket) err = this.ExpectNext(LBracket)
if err == nil { if err == nil {
this.Next()
for { for {
this.Next()
err := this.Expect(Ident, String, RBracket) err := this.Expect(Ident, String, RBracket)
if err != nil { return Selector { }, err } if err != nil { return Selector { }, err }
if this.Is(RBracket) { break } if this.Is(RBracket) { break }
@ -142,6 +142,7 @@ func (this *parser) parseSelector () (Selector, error) {
selector.Tags = append(selector.Tags, this.Value()) selector.Tags = append(selector.Tags, this.Value())
err = this.ExpectNext(Comma, RBracket) err = this.ExpectNext(Comma, RBracket)
if err != nil { return Selector { }, err } if err != nil { return Selector { }, err }
if this.Is(RBracket) { break }
} }
this.Next() this.Next()
} }