diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-08-31 13:02:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 13:02:55 -0400 |
| commit | 69025ad82238a7402b18d9c566fac1574faef684 (patch) | |
| tree | ab01e4248071f9f597aa04f15742852a7662ed23 /source/slang/slang-ast-dump.cpp | |
| parent | baa789e0c9109bcb1e717ce4a9953709e7345e55 (diff) | |
AST Serialization in Modules (#1524)
* First pass at filter for AST serial writing.
* Serialization of AST for modules.
* Removed some commented out source.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ast-dump.cpp')
| -rw-r--r-- | source/slang/slang-ast-dump.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp index 806a9146b..a821729a6 100644 --- a/source/slang/slang-ast-dump.cpp +++ b/source/slang/slang-ast-dump.cpp @@ -218,6 +218,7 @@ struct ASTDumpContext { if (m_dumpFlags & ASTDumpUtil::Flag::HideSourceLoc) { + ScopeWrite(this).getBuf() << "SourceLoc(0)"; return; } @@ -268,7 +269,7 @@ struct ASTDumpContext { ScopeWrite(this).getBuf() << " { " << TokenTypeToString(token.type) << ", "; dump(token.loc); - m_writer->emit(" "); + m_writer->emit(", "); dump(token.getContent()); m_writer->emit(" }"); } @@ -443,11 +444,11 @@ struct ASTDumpContext { if (qualType.isLeftValue) { - m_writer->emit("left "); + m_writer->emit("lvalue "); } else { - m_writer->emit("right "); + m_writer->emit("rvalue "); } dump(qualType.type); } @@ -580,8 +581,10 @@ struct ASTDumpContext void dump(ASTNodeType nodeType) { - SLANG_UNUSED(nodeType) - // Don't bother to output anything - as will already have been dumped with the object name + // Get the class + auto info = ReflectClassInfo::getInfo(nodeType); + // Write the name + m_writer->emit(info->m_name); } void dumpObjectFull(NodeBase* node); |
