summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-dump.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-11-02 12:12:18 -0700
committerGitHub <noreply@github.com>2022-11-02 12:12:18 -0700
commit2e1c15f36b42374455228e37885bdb221f302050 (patch)
tree57ab722b87e1ef327860e4293bad9edc53bba965 /source/slang/slang-ast-dump.cpp
parentfb29bd32cc3404455ff92916a91c517823f486dd (diff)
Rework differential conformance dictionary checking. (#2483)
* Rework differential conformance dictionary checking. * Revert space changes. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-dump.cpp')
-rw-r--r--source/slang/slang-ast-dump.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp
index 455a9db74..fc3c015e0 100644
--- a/source/slang/slang-ast-dump.cpp
+++ b/source/slang/slang-ast-dump.cpp
@@ -408,6 +408,35 @@ struct ASTDumpContext
m_writer->emit("}");
}
+ template <typename KEY, typename VALUE>
+ void dump(const OrderedDictionary<KEY, VALUE>& dict)
+ {
+ m_writer->emit(" { \n");
+ m_writer->indent();
+
+ for (auto iter : dict)
+ {
+ const auto& key = iter.Key;
+ const auto& value = iter.Value;
+
+ dump(key);
+ m_writer->emit(" : ");
+ dump(value);
+
+ m_writer->emit("\n");
+ }
+
+ m_writer->dedent();
+ m_writer->emit("}");
+ }
+
+ void dump(DeclRefBase declRef)
+ {
+ StringBuilder sb;
+ sb << declRef;
+ m_writer->emit(sb.ToString());
+ }
+
void dump(const DeclCheckStateExt& extState)
{
auto state = extState.getState();