tint: intrinsic-gen: Fix parsing of multiple decorations

Change-Id: I61365dea17ab9174cfcb2d513cf1f7ee28ce0647
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90528
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton 2022-05-19 18:05:09 +00:00 committed by Dawn LUCI CQ
parent b0664684cd
commit 0a63c6d2fb
2 changed files with 13 additions and 1 deletions

View File

@ -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
}
}

View File

@ -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{