ltlcross: diagnose missing i/o specifications earlier.

* src/misc/formater.cc, src/misc/formater.hh (scan): New method.
(prime): Use it.
* src/bin/ltlcross.cc (translator_runner::translator_runner): Scan each
specification string, and report those missing an input or output
%-sequence.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2013-01-21 10:20:25 +01:00
parent edd687a301
commit 6a547371d7
4 changed files with 52 additions and 12 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -23,18 +23,24 @@
namespace spot
{
void
formater::prime(const char* fmt)
formater::scan(const char* fmt, std::vector<bool>& has) const
{
for (const char* pos = fmt; *pos; ++pos)
if (*pos == '%')
{
char c = *++pos;
has_[c] = true;
has[c] = true;
if (!c)
break;
}
}
void
formater::prime(const char* fmt)
{
scan(fmt, has_);
}
std::ostream&
formater::format(const char* fmt)
{