summaryrefslogtreecommitdiffstats
path: root/tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-10-26 17:10:24 -0400
committerGitHub <noreply@github.com>2020-10-26 17:10:24 -0400
commit13945a51d932fc42fc1f31723ae64070d90708de (patch)
tree544ce2f88f6c2f2e9f5ac9cb0e7c7b88de68154e /tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp
parente702b704e15a3f0dcbcac6ae82b7cb3c10a4ced2 (diff)
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.
Diffstat (limited to 'tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp')
-rw-r--r--tools/slang-cpp-extractor/slang-cpp-extractor-main.cpp13
1 files changed, 12 insertions, 1 deletions
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);
}