Files
mercury/tests/general/string_format_test_3.exp2
Zoltan Somogyi 52ffbd1057 Generate better error messages for string.format.
library/string.format.m:
    We used to parse format strings, and pair up format specifiers with
    the list of input poly_types, using semidet code, throwing
    exceptions with generic messages if the semidet code failed.
    This diff switches to using det code that returns a list of
    situation-specific error messages. Since errors after the first
    may be caused by the first error, we now throw exceptions whose
    message is a detailed description of the first error, but that
    decision is easily changeable.

    Simplify some existing code.

tests/general/string_format_test_{2,3}.{exp,exp2,exp3,...}:
tests/invalid/string_format_bad.err_exp:
tests/invalid/string_format_unknown.err_exp:
    Update the expected error messages.
2014-11-15 19:38:53 +11:00

12 lines
640 B
Plaintext

Uncaught Mercury exception:
Software Error: string.format: The first conversion specifier, which uses specifier character `s', is missing its input.
Stack dump follows:
0 pred exception.throw/1-0 (erroneous) (exception.m:NNNN)
1 pred require.error/1-0 (erroneous) (require.m:NNNN)
2 pred string.conversion_specification/5-0 (semidet)
3 pred string.format_string/5-0 (det)
4 pred string.format/3-0 (det) (string.m:NNNN)
5 pred io.format/5-0 (det) (io.m:NNNN)
6 pred io.format/4-0 (det) (io.m:NNNN)
7 pred string_format_test_3.main/2-0 (det) (string_format_test_3.m:13)