Commit dc2a89f8 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

Do not output empty parse error blocks in the CGI script.

* wrap/python/spot.i: Provide a __nonzero__() method for
parse_error_list.
* wrap/python/cgi-bin/ltl2tgba.in: Do not call format_parse_errors()
unconditionally.
parent fe535a15
2011-01-17 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Do not output empty parse error blocks in the CGI script.
* wrap/python/spot.i: Provide a __nonzero__() method for
parse_error_list.
* wrap/python/cgi-bin/ltl2tgba.in: Do not call format_parse_errors()
unconditionally.
2011-01-12 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2011-01-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix "unused function" warnings reported by clang++. Fix "unused function" warnings reported by clang++.
......
...@@ -497,9 +497,10 @@ pel = spot.empty_parse_error_list() ...@@ -497,9 +497,10 @@ pel = spot.empty_parse_error_list()
f = spot.parse(formula, pel, env, show_parse) f = spot.parse(formula, pel, env, show_parse)
if show_parse: print '</pre>' if show_parse: print '</pre>'
print '<font color="red"><pre>' if pel:
err = spot.format_parse_errors(spot.get_cout(), formula, pel) print '<font color="red"><pre>'
print '</pre></font>' err = spot.format_parse_errors(spot.get_cout(), formula, pel)
print '</pre></font>'
if not f: if not f:
print '<p><b>Aborting...</b></p>' print '<p><b>Aborting...</b></p>'
......
...@@ -280,3 +280,13 @@ unblock_signal(int signum) ...@@ -280,3 +280,13 @@ unblock_signal(int signum)
} }
%} %}
%extend spot::ltl::parse_error_list {
bool
__nonzero__()
{
return !self->empty();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment