From f67d929c24babc302eb2807251fc09b084abac2e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 9 Mar 2022 18:38:00 -0500 Subject: Initial support for documentation extraction in C++ (#2156) * #include an absolute path didn't work - because paths were taken to always be relative. * Split doc extractor such that can be used in C++ extractor. * Compiles. Update the stdlib docs. * Fix issue on release builds. * Add support for extracting documentation to C++ extractor. * Dump out markup. Make enum value backing type take tokens. * Node::Type -> Node::Kind * More improvements around Node::Type -> Node::Kind --- tools/slang-cpp-extractor/parser.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/slang-cpp-extractor/parser.h') diff --git a/tools/slang-cpp-extractor/parser.h b/tools/slang-cpp-extractor/parser.h index f0febb728..5ed862d65 100644 --- a/tools/slang-cpp-extractor/parser.h +++ b/tools/slang-cpp-extractor/parser.h @@ -31,14 +31,14 @@ public: /// Parse the contents of the source file SlangResult parse(SourceOrigin* sourceOrigin, const Options* options); - void setTypeEnabled(Node::Type type, bool isEnabled = true); - bool isTypeEnabled(Node::Type type) { return (m_nodeTypeEnabled & (NodeTypeBitType(1) << int(type))) != 0; } - void setTypesEnabled(const Node::Type* types, Index typesCount, bool isEnabled = true); + void setKindEnabled(Node::Kind kind, bool isEnabled = true); + bool isTypeEnabled(Node::Kind kind) { return (m_nodeTypeEnabled & (NodeTypeBitType(1) << int(kind))) != 0; } + void setKindsEnabled(const Node::Kind* kinds, Index kindsCount, bool isEnabled = true); Parser(NodeTree* nodeTree, DiagnosticSink* sink); protected: - static Node::Type _toNodeType(IdentifierStyle style); + static Node::Kind _toNodeKind(IdentifierStyle style); bool _isMarker(const UnownedStringSlice& name); @@ -47,7 +47,7 @@ protected: SlangResult _parsePreDeclare(); SlangResult _parseTypeSet(); - SlangResult _maybeParseNode(Node::Type type); + SlangResult _maybeParseNode(Node::Kind kind); SlangResult _maybeParseField(); SlangResult _parseTypeDef(); -- cgit v1.2.3