diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-03-16 15:19:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-16 15:19:20 -0400 |
| commit | 4cb899f824ee5e4421f36506e4c77f682b238b09 (patch) | |
| tree | c348029866666fad59531032ba76f325d67c32ab /tools/slang-unit-test/unit-test-json-native.cpp | |
| parent | 1036d1a9edec83d8840577f388af8599b5e18f5f (diff) | |
Preliminary SourceMap support (#2701)
* #include an absolute path didn't work - because paths were taken to always be relative.
* WIP source map.
* Split out handling of RttiTypeFuncs to a map type.
* Make RttiTypeFuncsMap hold default impls.
* Slightly more sophisticated RttiTypeFuncsMap
* Source map decoding.
* Fix tabs.
* Fix asserts due to negative values.
* Use less obscure mechanisms in SourceMap.
Diffstat (limited to 'tools/slang-unit-test/unit-test-json-native.cpp')
| -rw-r--r-- | tools/slang-unit-test/unit-test-json-native.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/slang-unit-test/unit-test-json-native.cpp b/tools/slang-unit-test/unit-test-json-native.cpp index 6636cc04a..546131e4b 100644 --- a/tools/slang-unit-test/unit-test-json-native.cpp +++ b/tools/slang-unit-test/unit-test-json-native.cpp @@ -107,11 +107,13 @@ static SlangResult _check() DiagnosticSink sink(&sourceManager, &JSONLexer::calcLexemeLocation); + auto typeMap = JSONNativeUtil::getTypeFuncsMap(); + RefPtr<JSONContainer> container(new JSONContainer(&sourceManager)); String json; { - NativeToJSONConverter converter(container, &sink); + NativeToJSONConverter converter(container, &typeMap, &sink); JSONValue value; SLANG_RETURN_ON_FAIL(converter.convert(GetRttiInfo<SomeStruct>::get(), &s, value)); @@ -143,7 +145,7 @@ static SlangResult _check() // Convert back to native { - JSONToNativeConverter converter(container, &sink); + JSONToNativeConverter converter(container, &typeMap, &sink); { SomeStruct readS; |
