diff options
Diffstat (limited to 'source/compiler-core/slang-json-value.h')
| -rw-r--r-- | source/compiler-core/slang-json-value.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/compiler-core/slang-json-value.h b/source/compiler-core/slang-json-value.h index b94283d81..2e8707a87 100644 --- a/source/compiler-core/slang-json-value.h +++ b/source/compiler-core/slang-json-value.h @@ -233,9 +233,17 @@ public: /// Set the source manager void setSourceManager(SourceManager* sourceManger) { m_sourceManager = sourceManger; } + /// Clears all the source locs. Useful if the sourceManager is no longer available, or has itself been reset. + /// All JSONValues which were Lexeme based will become held in the container + /// The source manager will set to nullptr + void clearSourceManagerDependency(JSONValue* ioValues, Index count); + /// Reset the state void reset(); + /// Return inValue as a regular value (ie not held as a lexeme) + JSONValue asValue(const JSONValue& inValue); + // Ctor JSONContainer(SourceManager* sourceManger); @@ -278,6 +286,9 @@ protected: /// True if the key and value are equal bool _areEqualOrderedKeys(const JSONKeyValue* a, const JSONKeyValue* b, Index count); + void _clearSourceManagerDependency(JSONValue* ioValues, Index count); + JSONValue _removeManagerDependency(const JSONValue& inValue); + StringBuilder m_buf; ///< A temporary buffer used to hold unescaped strings SourceView* m_currentView = nullptr; |
