diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/compiler-core/slang-json-source-map-util.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/compiler-core/slang-json-source-map-util.h')
| -rw-r--r-- | source/compiler-core/slang-json-source-map-util.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/source/compiler-core/slang-json-source-map-util.h b/source/compiler-core/slang-json-source-map-util.h index d61936ce4..0e6f4248c 100644 --- a/source/compiler-core/slang-json-source-map-util.h +++ b/source/compiler-core/slang-json-source-map-util.h @@ -1,29 +1,40 @@ #ifndef SLANG_COMPILER_CORE_JSON_SOURCE_MAP_UTIL_H #define SLANG_COMPILER_CORE_JSON_SOURCE_MAP_UTIL_H -#include "slang-source-map.h" - #include "slang-json-value.h" +#include "slang-source-map.h" -namespace Slang { - -struct JSONSourceMapUtil +namespace Slang { - /// Decode from root into the source map - static SlangResult decode(JSONContainer* container, JSONValue root, DiagnosticSink* sink, SourceMap& out); - - /// Converts the source map contents into JSON - static SlangResult encode(const SourceMap& sourceMap, JSONContainer* container, DiagnosticSink* sink, JSONValue& outValue); - /// Read the blob (encoded as JSON) as a source map. - /// Sink is optional, and can be passed as nullptr +struct JSONSourceMapUtil +{ + /// Decode from root into the source map + static SlangResult decode( + JSONContainer* container, + JSONValue root, + DiagnosticSink* sink, + SourceMap& out); + + /// Converts the source map contents into JSON + static SlangResult encode( + const SourceMap& sourceMap, + JSONContainer* container, + DiagnosticSink* sink, + JSONValue& outValue); + + /// Read the blob (encoded as JSON) as a source map. + /// Sink is optional, and can be passed as nullptr static SlangResult read(ISlangBlob* blob, DiagnosticSink* sink, SourceMap& outSourceMap); static SlangResult read(ISlangBlob* blob, SourceMap& outSourceMap); - /// Write source map to outBlob JSON + /// Write source map to outBlob JSON static SlangResult write(const SourceMap& sourceMap, ComPtr<ISlangBlob>& outBlob); - /// Write out the source map into a blob - static SlangResult write(const SourceMap& sourceMap, DiagnosticSink* sink, ComPtr<ISlangBlob>& outBlob); + /// Write out the source map into a blob + static SlangResult write( + const SourceMap& sourceMap, + DiagnosticSink* sink, + ComPtr<ISlangBlob>& outBlob); }; } // namespace Slang |
