#157: Change error message for non-positive IDs

This commit is contained in:
Janik Rabe 2018-08-07 15:31:01 +03:00 committed by lauft
parent 48aa9cfdc0
commit 616ca4b884
2 changed files with 5 additions and 3 deletions

View file

@ -412,9 +412,11 @@ void CLI::identifyIds ()
int digits;
if (pig.skipLiteral ("@") &&
pig.getDigits (digits) &&
pig.eos () &&
digits > 0)
pig.eos ())
{
if (digits <= 0)
throw format ("'@{1}' is not a valid ID.", digits);
a.tag ("ID");
a.attribute ("value", digits);
}