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:
parent
b0664684cd
commit
0a63c6d2fb
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue