format-parser: Improve error message when format specifier lacks width.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 25 Nov 2012 01:26:38 +0000 (17:26 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 25 Nov 2012 01:26:38 +0000 (17:26 -0800)
commit55740f362a5218c87e61858a672540f4909d5e06
tree07743746844746da7d5a6faa9e8e8b64c1ed1455
parent00175c601a93d7adba981851860fdf9d72ec9119
format-parser: Improve error message when format specifier lacks width.

Until now, parse_format_specifier() was willing to parse, e.g. "datetime"
as a format specifier.  It would then be rejected later by e.g.
fmt_check_input() with a message like "Input format DATETIME0.0 specifies
width 0, but DATETIME requires a width between 17 and 40," which makes no
sense to the user.  This commit improves the error message.
src/language/lexer/format-parser.c
tests/language/expressions/evaluate.at