From 13945a51d932fc42fc1f31723ae64070d90708de Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 26 Oct 2020 17:10:24 -0400 Subject: Value type serialization via C++ Extractor (#1588) * #include an absolute path didn't work - because paths were taken to always be relative. * Fix handling of access modifiers inside type definition. * Fix access problem for AST node. Make dumping produce a single function with switch, to potentially make available without Dump specific access. * WIP on serialization design doc. * Remove project references to previously generated files. * More docs on serialization design. * Improve serialization documentation. Remove unused function from IRSerialReader. * Small fixes around naming. Remove long comment from slang-serialize.h - as covered in serialization.md * Remove long comment in slang-serialize.h as covered in serialization.md * More information about doing replacements on read for AST and problems surrounding. * Typo fix. * Spelling fixes. * Value serialize. * Value types with inheritence. * Use value reflection serial conversion for more AST types * Use automatic serialization on more of AST. * Get the types via decltype, simplifies what the extractor has to do. * Update the serialization.md for the value serialization. * Small doc improvements. * Update project. --- tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp') diff --git a/tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp b/tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp index f71ae2fd6..1fc68ebe6 100644 --- a/tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp +++ b/tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp @@ -1647,6 +1647,17 @@ SlangResult CPPExtractor::_maybeParseField() switch (m_reader.peekTokenType()) { case TokenType::OpAssign: + { + // Special case to handle + // Type operator=(... + + m_reader.advanceToken(); + if (m_reader.peekTokenType() == TokenType::LParent) + { + // Not a field + break; + } + } case TokenType::Semicolon: { Node::Field field; @@ -2534,7 +2545,7 @@ SlangResult CPPExtractorApp::writeOutput(CPPExtractor& extractor) // Some keywords { - const char* names[] = { "virtual", "typedef", "continue", "if", "case", "break", "catch", "default", "delete", "do", "else", "for", "new", "goto", "return", "switch", "throw", "using", "while" }; + const char* names[] = { "virtual", "typedef", "continue", "if", "case", "break", "catch", "default", "delete", "do", "else", "for", "new", "goto", "return", "switch", "throw", "using", "while", "operator" }; outLookup.set(names, SLANG_COUNT_OF(names), IdentifierStyle::Keyword); } -- cgit v1.2.3