Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed printing of error messages in the parser #151

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/PetriEngine/PQL/Analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace PetriEngine { namespace PQL {
if (result.success) {
element->_offsetInMarking = result.offset;
} else {
throw base_error("Unable to resolve identifier \"", element->name(), "\"");
throw base_error("Unable to resolve identifier \"", *element->name(), "\"");
}
}

Expand All @@ -161,7 +161,7 @@ namespace PetriEngine { namespace PQL {
AnalysisContext::ResolutionResult result = _context.resolve(element->getName(), false);
if (!result.success)
{
throw base_error("Unable to resolve identifier \"", element->getName(), "\"");
throw base_error("Unable to resolve identifier \"", *element->getName(), "\"");
return;
}

Expand Down Expand Up @@ -203,7 +203,7 @@ namespace PetriEngine { namespace PQL {
if (!coloredContext->resolveTransition(element->getName(), [&](const shared_const_string& tname) {
names.emplace_back(tname);
})) {
throw base_error("Unable to resolve colored identifier \"", element->getName(), "\"");
throw base_error("Unable to resolve colored identifier \"", *element->getName(), "\"");
}
if(names.size() < 1){
//If the transition points to empty vector we know that it has
Expand Down
4 changes: 2 additions & 2 deletions src/PetriEngine/PQL/ColoredUseVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace PetriEngine { namespace PQL {
void ColoredUseVisitor::_accept(const FireableCondition *element) {
auto it = _transitionNameToIndexMap.find(element->getName());
if (it == _transitionNameToIndexMap.end())
throw base_error("Unable to resolve identifier \"", element->getName(), "\"");
throw base_error("Unable to resolve identifier \"", *element->getName(), "\"");
_transitionInUse[it->second] = true;
_anyTransitionInUse = true;
}
Expand All @@ -81,7 +81,7 @@ namespace PetriEngine { namespace PQL {
void ColoredUseVisitor::_accept(const IdentifierExpr *element) {
auto it = _placeNameToIndexMap.find(element->name());
if (it == _placeNameToIndexMap.end())
throw base_error("Unable to resolve identifier \"", element->name(), "\"");
throw base_error("Unable to resolve identifier \"", *element->name(), "\"");
_placeInUse[it->second] = true;
}

Expand Down
Loading