dawn_node: handle literals on typdef'd interface members

Bug: dawn:1123
Change-Id: Ie7f388a0322b195937aa76ab30b1513ca642b572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75901
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-01-10 15:23:21 +00:00 committed by Dawn LUCI CQ
parent 4fe5d65446
commit 6d9ee4254b
1 changed files with 3 additions and 2 deletions

View File

@ -84,9 +84,10 @@ See:
{{- if IsDefaultDictionaryLiteral $.Value}}{{template "Type" $.Type}}{} {{- if IsDefaultDictionaryLiteral $.Value}}{{template "Type" $.Type}}{}
{{- else if IsTypeName $.Type }} {{- else if IsTypeName $.Type }}
{{- $ty := Lookup $.Type.Name}} {{- $ty := Lookup $.Type.Name}}
{{- if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}} {{- if IsTypedef $ty }}{{Eval "Literal" "Value" $.Value "Type" $ty.Type}}
{{- else if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}}
{{- else if IsBasicLiteral $.Value }}{{$.Value.Value}} {{- else if IsBasicLiteral $.Value }}{{$.Value.Value}}
{{- else }}/* Unhandled Type {{printf "ty: %v $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */ {{- else }}/* Unhandled Type {{printf "ty: %T $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */
{{- end }} {{- end }}
{{- else if IsSequenceType $.Type }}{{template "Type" $.Type}}{} {{- /* TODO: Assumes the initialiser is empty */}} {{- else if IsSequenceType $.Type }}{{template "Type" $.Type}}{} {{- /* TODO: Assumes the initialiser is empty */}}
{{- else if IsBasicLiteral $.Value }}{{$.Value.Value}} {{- else if IsBasicLiteral $.Value }}{{$.Value.Value}}