mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
library/string.m:
Define first_char/3 to fail if the input string begins with an
ill-formed code unit sequence.
Define the reverse mode to throw an exception on an attempt to
encode a null character or surrogate code point in the output
string.
Reimplement first_char/3 in Mercury.
hard_coded/Mmakefile:
hard_coded/string_first_char_ilseq.exp:
hard_coded/string_first_char_ilseq.m:
Add test case.
11 lines
514 B
Plaintext
11 lines
514 B
Plaintext
first_char(in, out, in) failed
|
|
first_char(in, out, out) failed
|
|
first_char(in, in, in) failed
|
|
first_char(in, in, out) failed
|
|
first_char(in, in, in) failed
|
|
first_char(in, in, out) failed
|
|
first_char(in, in, in) failed
|
|
first_char(in, in, out) failed
|
|
first_char(out, in, in) threw exception: software_error("predicate `string.first_char_str_out\'/3: Unexpected: surrogate code point")
|
|
first_char(out, in, in) threw exception: software_error("predicate `string.first_char_str_out\'/3: Unexpected: surrogate code point")
|