diff options
| author | Yong He <yonghe@outlook.com> | 2024-08-19 15:03:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-19 15:03:56 -0700 |
| commit | 453683bf44f2112719802eaac2b332d49eebd640 (patch) | |
| tree | d399db4c9cba90c11980186d3df1ffcc4d423b5a /source/slang/slang-ast-dump.cpp | |
| parent | ecf85df6eee3da76ef54b14e4ab083f22da89e46 (diff) | |
Tuple swizzling, concat, comparison and `countof`. (#4856)
* Tuple swizzling and element access.
* Update proposal status.
* Cleanup.
* Fix merrge error.
* Address review.
Diffstat (limited to 'source/slang/slang-ast-dump.cpp')
| -rw-r--r-- | source/slang/slang-ast-dump.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp index 8b2494310..a1ab7a5c8 100644 --- a/source/slang/slang-ast-dump.cpp +++ b/source/slang/slang-ast-dump.cpp @@ -203,6 +203,27 @@ struct ASTDumpContext m_writer->emit("}"); } + template <typename T, int n> + void dump(const ShortList<T, n>& list) + { + m_writer->emit(" { \n"); + m_writer->indent(); + for (Index i = 0; i < list.getCount(); ++i) + { + dump(list[i]); + if (i < list.getCount() - 1) + { + m_writer->emit(",\n"); + } + else + { + m_writer->emit("\n"); + } + } + m_writer->dedent(); + m_writer->emit("}"); + } + void dump(SourceLoc sourceLoc) { if (m_dumpFlags & ASTDumpUtil::Flag::HideSourceLoc) @@ -285,6 +306,10 @@ struct ASTDumpContext { m_writer->emit(UInt(v)); } + void dump(UInt v) + { + m_writer->emit(v); + } void dump(int32_t v) { m_writer->emit(v); |
