Skip to content

Commit 153d1d9

Browse files
committed
runtime: Fix getPragmaValues only returning one item per pragma type
1 parent c2e4a67 commit 153d1d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/include/pl/pattern_language.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace pl {
127127
* @param source the source of the code
128128
* @return Key-value pairs of all pragmas that were set
129129
*/
130-
[[nodiscard]] std::map<std::string, std::string> getPragmaValues(const std::string &code, const std::string &source = api::Source::DefaultSource) const;
130+
[[nodiscard]] std::multimap<std::string, std::string> getPragmaValues(const std::string &code, const std::string &source = api::Source::DefaultSource) const;
131131

132132
/**
133133
* @brief Aborts the currently running execution asynchronously

lib/source/pl/pattern_language.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ namespace pl {
338338
return this->m_fileResolver.addVirtualFile(code, source, mainSource);
339339
}
340340

341-
std::map<std::string, std::string> PatternLanguage::getPragmaValues(const std::string &code, const std::string &source) const {
342-
std::map<std::string, std::string> pragmaValues;
341+
std::multimap<std::string, std::string> PatternLanguage::getPragmaValues(const std::string &code, const std::string &source) const {
342+
std::multimap<std::string, std::string> pragmaValues;
343343

344344
const api::Source plSource(code, source);
345345
const auto result = m_internals.lexer->lex(&plSource);

0 commit comments

Comments
 (0)