Skip to content

Commit

Permalink
Remove non-compliant characters from symbol names
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanoKobalamyne committed Nov 6, 2024
1 parent dfcb29c commit 2a4f021
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontends/btor2_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "btor2_encoder.h"
#include "utils/logger.h"

#include <cstddef>
#include <iostream>
#include "assert.h"

Expand Down Expand Up @@ -289,6 +290,12 @@ void BTOR2Encoder::parse(const std::string filename)
if (l_->tag == BTOR2_TAG_state) {
if (l_->symbol) {
symbol_ = l_->symbol;
for (auto ch : {':', '\\'}) {
std::size_t pos;
while((pos = symbol_.find(ch)) != symbol_.npos) {
symbol_.replace(pos, 1, "_");
}
}
} else {
auto renaming_lookup_pos = state_renaming_table.find(l_->id);
if (renaming_lookup_pos != state_renaming_table.end() )
Expand Down

0 comments on commit 2a4f021

Please sign in to comment.