* src/misc/bareword.hh, src/misc/bareword.cc (quote_unless_bare_word):
New function.
This commit is contained in:
parent
38f7cac8dd
commit
d9b29a0590
3 changed files with 18 additions and 0 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
2004-10-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
2004-10-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/misc/bareword.hh, src/misc/bareword.cc (quote_unless_bare_word):
|
||||||
|
New function.
|
||||||
|
|
||||||
* src/ltlvisit/tostring.cc (to_spin_string_visitor): Move to
|
* src/ltlvisit/tostring.cc (to_spin_string_visitor): Move to
|
||||||
anonymous namespace.
|
anonymous namespace.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "bareword.hh"
|
#include "bareword.hh"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "escape.hh"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
@ -37,4 +38,14 @@ namespace spot
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
quote_unless_bare_word(const std::string& str)
|
||||||
|
{
|
||||||
|
if (is_bare_word(str.c_str()))
|
||||||
|
return str;
|
||||||
|
else
|
||||||
|
return "\"" + escape_str(str) + "\"";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
// 02111-1307, USA.
|
// 02111-1307, USA.
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
bool is_bare_word(const char* str);
|
bool is_bare_word(const char* str);
|
||||||
|
|
||||||
|
std::string quote_unless_bare_word(const std::string& str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue