diff options
| author | Yong He <yonghe@outlook.com> | 2022-11-16 12:17:49 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 12:17:49 -0800 |
| commit | 801aa3b44254341018a1acbe754f2ce3b0900e2a (patch) | |
| tree | b3066778522edb99bf64c0ac80c91b0b4cb788f8 /source/slang/slang-ast-print.cpp | |
| parent | 09d8e048d2264d89886cda8e87e8a452d4f913c1 (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-print.cpp')
| -rw-r--r-- | source/slang/slang-ast-print.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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 << "<error>"; return; } + type = type->getCanonicalType(); if (m_optionFlags & OptionFlag::SimplifiedBuiltinType) { if (auto vectorType = as<VectorExpressionType>(type)) @@ -357,9 +358,16 @@ void ASTPrinter::addDeclKindPrefix(Decl* decl) continue; if (as<BuiltinModifier>(modifier)) continue; + if (as<BuiltinRequirementModifier>(modifier)) + continue; if (as<BuiltinTypeModifier>(modifier)) continue; + if (as<SpecializedForTargetModifier>(modifier)) + continue; } + // Don't print out attributes. + if (as<AttributeBase>(modifier)) + continue; m_builder << modifier->getKeywordName()->text << " "; } } @@ -462,7 +470,9 @@ void ASTPrinter::addDeclResultType(const DeclRef<Decl>& inDeclRef) /* static */String ASTPrinter::getDeclSignatureString(DeclRef<Decl> declRef, ASTBuilder* astBuilder) { - ASTPrinter astPrinter(astBuilder); + ASTPrinter astPrinter( + astBuilder, + ASTPrinter::OptionFlag::NoInternalKeywords | ASTPrinter::OptionFlag::SimplifiedBuiltinType); astPrinter.addDeclSignature(declRef); return astPrinter.getString(); } |
