From 801aa3b44254341018a1acbe754f2ce3b0900e2a Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 16 Nov 2022 12:17:49 -0800 Subject: Clean up type checking of higher order expressions. (#2519) * Clean up type checking of higher order expressions. * Replace `goto` with `break` to pacify clang. * Fix. * Fixes. * Fix more tests. * Fix lowerWitnessTable parameter error. * Exclude attributes from ast printing. Co-authored-by: Yong He --- source/slang/slang-ast-print.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ast-print.cpp') diff --git a/source/slang/slang-ast-print.cpp b/source/slang/slang-ast-print.cpp index 830c6bf34..107ec64c5 100644 --- a/source/slang/slang-ast-print.cpp +++ b/source/slang/slang-ast-print.cpp @@ -31,6 +31,7 @@ void ASTPrinter::addType(Type* type) m_builder << ""; return; } + type = type->getCanonicalType(); if (m_optionFlags & OptionFlag::SimplifiedBuiltinType) { if (auto vectorType = as(type)) @@ -357,9 +358,16 @@ void ASTPrinter::addDeclKindPrefix(Decl* decl) continue; if (as(modifier)) continue; + if (as(modifier)) + continue; if (as(modifier)) continue; + if (as(modifier)) + continue; } + // Don't print out attributes. + if (as(modifier)) + continue; m_builder << modifier->getKeywordName()->text << " "; } } @@ -462,7 +470,9 @@ void ASTPrinter::addDeclResultType(const DeclRef& inDeclRef) /* static */String ASTPrinter::getDeclSignatureString(DeclRef declRef, ASTBuilder* astBuilder) { - ASTPrinter astPrinter(astBuilder); + ASTPrinter astPrinter( + astBuilder, + ASTPrinter::OptionFlag::NoInternalKeywords | ASTPrinter::OptionFlag::SimplifiedBuiltinType); astPrinter.addDeclSignature(declRef); return astPrinter.getString(); } -- cgit v1.2.3