diff --git a/tools/src/cmd/intrinsic-gen/parser/parser.go b/tools/src/cmd/intrinsic-gen/parser/parser.go index b0acb44c38..f381b3a7b0 100644 --- a/tools/src/cmd/intrinsic-gen/parser/parser.go +++ b/tools/src/cmd/intrinsic-gen/parser/parser.go @@ -154,7 +154,7 @@ func (p *parser) decorations() ast.Decorations { Name: string(name.Runes), Values: values, }) - if !p.peekIs(0, tok.Comma) { + if p.match(tok.Comma) == nil { break } } diff --git a/tools/src/cmd/intrinsic-gen/parser/parser_test.go b/tools/src/cmd/intrinsic-gen/parser/parser_test.go index 0ca1f686bc..0dea9b3239 100644 --- a/tools/src/cmd/intrinsic-gen/parser/parser_test.go +++ b/tools/src/cmd/intrinsic-gen/parser/parser_test.go @@ -90,6 +90,18 @@ func TestParser(t *testing.T) { Name: "T", }}, }, + }, { /////////////////////////////////////////////////////////////////// + utils.ThisLine(), + "[[deco_a, deco_b]] type T", + ast.AST{ + Types: []ast.TypeDecl{{ + Decorations: ast.Decorations{ + {Name: "deco_a", Values: []string{}}, + {Name: "deco_b", Values: []string{}}, + }, + Name: "T", + }}, + }, }, { /////////////////////////////////////////////////////////////////// utils.ThisLine(), `[[deco("a", "b")]] type T`, ast.AST{