mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
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.
9 lines
377 B
Plaintext
9 lines
377 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:
|
|
mercury__exception:-throw_impl_1_p_0/1-fun-0-/1
|
|
mercury__string:format_string_to_specifiers_5_p_0/2
|
|
mercury__string:format_3_p_0/2
|
|
mercury__io:format_4_p_0/2
|
|
string_format_test_3:mercury__main_wrapper/0
|