diff --git a/include/xo/reader2/SchematikaParser.hpp b/include/xo/reader2/SchematikaParser.hpp index 96de8628..ce7b3335 100644 --- a/include/xo/reader2/SchematikaParser.hpp +++ b/include/xo/reader2/SchematikaParser.hpp @@ -220,6 +220,10 @@ namespace xo { **/ void begin_batch_session(); + /** intern string @p str in global string table + **/ + const DUniqueString * intern_string(std::string_view str); + /** include next token @p tk and increment parser state. * * @param tk next input token diff --git a/include/xo/reader2/SchematikaReader.hpp b/include/xo/reader2/SchematikaReader.hpp index efd031ca..5d20226e 100644 --- a/include/xo/reader2/SchematikaReader.hpp +++ b/include/xo/reader2/SchematikaReader.hpp @@ -78,6 +78,10 @@ namespace xo { **/ void begin_batch_session(); + /** intern string @p str in global string table + **/ + const DUniqueString * intern_string(std::string_view str); + /** consume input @p input_cstr **/ const ReaderResult & read_expr(span_type input_span, bool eof); diff --git a/src/reader2/SchematikaParser.cpp b/src/reader2/SchematikaParser.cpp index 25b3bc7f..12f15bd6 100644 --- a/src/reader2/SchematikaParser.cpp +++ b/src/reader2/SchematikaParser.cpp @@ -81,6 +81,12 @@ namespace xo { DToplevelSeqSsm::establish_batch(psm_.parser_alloc(), &psm_); } + const DUniqueString * + SchematikaParser::intern_string(std::string_view str) + { + return psm_.intern_string(str); + } + const ParserResult & SchematikaParser::on_token(const token_type & tk) { diff --git a/src/reader2/SchematikaReader.cpp b/src/reader2/SchematikaReader.cpp index c3e13254..f9cad55a 100644 --- a/src/reader2/SchematikaReader.cpp +++ b/src/reader2/SchematikaReader.cpp @@ -58,6 +58,12 @@ namespace xo { // TODO: // Schematika::end_interactive_session() + const DUniqueString * + SchematikaReader::intern_string(std::string_view str) + { + return parser_.intern_string(str); + } + const ReaderResult & SchematikaReader::read_expr(span_type input_ext, bool eof) {