From c42a9faad8d84f7bd05457d5f8e1fe45d6eecfa2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 8 Oct 2024 13:29:57 -0700 Subject: Overhaul docgen tool and setup CI to generate stdlib reference. (#5232) * Overhaul docgen tool and setup CI to generate stdlib reference. * Fix build error. * Write parsed doc for all decls. * fix. * fix callout. * Fix. * Fix comment. * Fix. * Delete obsolete doc tests. * Fix. * Categorize functions and types. * Fix CI. * Update comments. --- source/slang/slang-ast-print.cpp | 15 ++++++++++++++- 1 file changed, 14 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 f5f99f01d..f3ed4ee0b 100644 --- a/source/slang/slang-ast-print.cpp +++ b/source/slang/slang-ast-print.cpp @@ -1,6 +1,8 @@ // slang-ast-print.cpp #include "slang-ast-print.h" +#include "core/slang-char-util.h" + #include "slang-check-impl.h" namespace Slang { @@ -81,7 +83,11 @@ void ASTPrinter::addVal(Val* val) } else { - out << getText(decl->getName()); + auto text = getText(decl->getName()); + if (text.getLength() && !(CharUtil::isAlphaOrDigit(text[0]) || text[0] == '_')) + out << "operator" << text; + else + out << text; } } @@ -140,6 +146,13 @@ void ASTPrinter::_addDeclPathRec(const DeclRef& declRef, Index depth) { ExtensionDecl* extensionDecl = as(parentDeclRef.getDecl()); Type* type = extensionDecl->targetType.type; + if (m_optionFlags & OptionFlag::NoSpecializedExtensionTypeName) + { + if (auto unspecializedDeclRef = isDeclRefTypeOf(type)) + { + type = DeclRefType::create(m_astBuilder, unspecializedDeclRef.getDecl()->getDefaultDeclRef()); + } + } addType(type); sb << toSlice("."); } -- cgit v1.2.3