ast: Add ast::NamedType

Have ast::Struct and ast::Alias derive from it.
NamedType currently derives from ast::Type, but this might change in the future.

Bug: tint:724
Change-Id: I46ab7751c89176f4dec34d63247d2459d02ab6bb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49525
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton
2021-04-30 19:58:49 +00:00
committed by Commit Bot service account
parent 77a7518c95
commit 1737485a05
10 changed files with 126 additions and 40 deletions

View File

@@ -40,7 +40,7 @@ TEST_F(ParserImplTest, TypeDecl_ParsesType) {
TEST_F(ParserImplTest, TypeDecl_ParsesStruct_Ident) {
auto p = parser("type a = B");
auto str = Structure(p->builder().Symbols().Register("B"), {});
auto str = p->builder().Structure(p->builder().Symbols().Register("B"), {});
p->register_constructed("B", str);
auto t = p->type_alias();