Print '{!a}*' rather than '!a*'.

* src/ltlvisit/tostring.cc: Use braces for unary operators in
Star.
* src/ltltest/tostring.test: Add some PSL formulae, it cannot
hurt.
This commit is contained in:
Alexandre Duret-Lutz 2010-03-13 00:32:06 +01:00
parent aef6c1a06b
commit 47b2bea865
2 changed files with 13 additions and 3 deletions

View file

@ -233,7 +233,9 @@ namespace spot
return;
}
// 1* is OK, no need to print {1}*.
need_parent = false;
// However want braces for {!a}*, the only unary
// operator that can be nested with *.
need_parent = !!dynamic_cast<const unop*>(uo->child());
// Do not output anything yet, star is a postfix operator.
break;
}
@ -481,8 +483,11 @@ namespace spot
os_ << "*";
return;
}
// 1* is OK, no need to print {1}*.
// However want braces for {!a}*, the only unary
// operator that can be nested with *.
need_parent = !!dynamic_cast<const unop*>(uo->child());
// Do not output anything yet, star is a postfix operator.
need_parent = false;
break;
}