Skip to content

Commit

Permalink
(#290) replace ^ -> \textasciicircum для отчета
Browse files Browse the repository at this point in the history
+ убрала свои ворнинги
  • Loading branch information
mathhyyn committed Nov 19, 2023
1 parent dbc1bbf commit bebf6c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 2 additions & 4 deletions libs/Interpreter/src/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,10 @@ std::optional<GeneralObject> Interpreter::apply_function(const Function& functio
logger.log("running function \"" + function.name + "\"");

auto get_automaton = [](const GeneralObject& obj) -> const FiniteAutomaton& {
if (std::holds_alternative<ObjectNFA>(obj)) {
if (std::holds_alternative<ObjectNFA>(obj))
return std::get<ObjectNFA>(obj).value;
}
if (std::holds_alternative<ObjectDFA>(obj)) {
else
return std::get<ObjectDFA>(obj).value;
}
};

auto is_automaton = [](const GeneralObject& obj) -> const bool {
Expand Down
8 changes: 5 additions & 3 deletions libs/Logger/src/LogTemplate.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <algorithm>
#include <cmath>
#include <regex>
#include <variant>

#include "Logger/LogTemplate.h"
Expand Down Expand Up @@ -104,9 +105,10 @@ string LogTemplate::render() const {
}

if (std::holds_alternative<Regex>(param.value)) {
s.insert(insert_place,
std::get<Regex>(param.value)
.to_txt()); // Math mode is done in global renderer
// Math mode is done in global renderer
string r0 = std::get<Regex>(param.value).to_txt();
string r = std::regex_replace(r0, std::regex("\\^"), "\\textasciicircum ");
s.insert(insert_place, r);
} else if (std::holds_alternative<FiniteAutomaton>(param.value)) {
std::hash<string> hasher;
string c_graph;
Expand Down
4 changes: 2 additions & 2 deletions libs/Objects/src/FiniteAutomaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ FiniteAutomaton FiniteAutomaton::minimize(bool is_trim, iLogTemplate* log) const

std::stringstream ss;
for (const auto& state : minimized_dfa.states) {
ss << "\\{" << state.identifier << "\\}\;";
ss << "\\{" << state.identifier << "\\};";
}
MetaInfo old_meta, new_meta;
for (int i = 0; i < dfa.states.size(); i++) {
Expand Down Expand Up @@ -1363,7 +1363,7 @@ FiniteAutomaton FiniteAutomaton::merge_bisimilar(iLogTemplate* log) const {
ss << "\\{";
for (int i = 0; i < elem.second.size() - 1; i++)
ss << elem.second[i]->name << ",\\ ";
ss << elem.second[elem.second.size() - 1]->name << "\\}\;";
ss << elem.second[elem.second.size() - 1]->name << "\\};";
}
if (log) {
log->set_parameter("oldautomaton", *this, old_meta);
Expand Down
8 changes: 4 additions & 4 deletions libs/Objects/src/Grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,20 @@ string Grammar::pg_to_txt() const {
}
}
for (const auto& elem : out) {
ss << elem << "\\\\";
ss << elem << "\\\\\n";
}
ss << "------------------------- Базисные слова -----------------------"
<< "\\\\";
<< "\n\n";

for (int i = 0; i < prefix_grammar.size(); i++) {
if (prefix_grammar[i].is_terminal) {
const PrefixGrammarItem& g = prefix_grammar[i];
for (const auto& w : g.equivalence_class) {
if (w == "") {
ss << "eps"
<< "\;";
<< ";";
} else {
ss << w << "\;";
ss << w << ";";
}
}
ss << "\\\\";
Expand Down

0 comments on commit bebf6c8

Please sign in to comment.