python: improve formating of double-quoted AP in MathJax

* python/spot/impl.i: Move the rendering code...
* python/spot/__init__.py: ... here, and ajust it for MathJax.
* tests/python/formulas.ipynb, tests/python/ltsmin-dve.ipynb: Adjust
expected results.
This commit is contained in:
Alexandre Duret-Lutz 2018-05-15 17:27:21 +02:00
parent 965d0ed6b7
commit 36b5b76ca5
4 changed files with 127 additions and 127 deletions

View file

@ -683,59 +683,6 @@ def state_is_accepting(self, src) -> "bool":
}
}
%extend std::set<spot::formula> {
std::string __str__()
{
std::ostringstream s;
s << "{";
bool comma = false;
for (auto& i: *self)
{
if (comma)
s << ", ";
else
comma = true;
spot::print_psl(s, i);
}
s << "}";
return s.str();
}
std::string __repr__()
{
std::ostringstream s;
s << "{";
bool comma = false;
for (auto& i: *self)
{
if (comma)
s << ", ";
else
comma = true;
spot::print_psl(s, i);
}
s << "}";
return s.str();
}
std::string _repr_latex_()
{
std::ostringstream s;
s << "$\\{";
bool comma = false;
for (auto& i: *self)
{
if (comma)
s << ", ";
else
comma = true;
spot::print_sclatex_psl(s, i);
}
s << "\\}$";
return s.str();
}
}
%exception spot::formula::__getitem__ {
try {
@ -755,10 +702,6 @@ def state_is_accepting(self, src) -> "bool":
formula __getitem__(unsigned pos) { return (*self)[pos]; }
std::string __repr__() { return spot::str_psl(*self); }
std::string _repr_latex_()
{
return std::string("$") + spot::str_sclatex_psl(*self) + '$';
}
std::string __str__() { return spot::str_psl(*self); }
}