mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
Formatting of uints using string.format etc.
Extend the operations that perform formatted conversion, such as string.format/2, to be able to handle values of type uint directly. We have always supported formatting values of type int as unsigned values, but currently the only way to format uint values is by explicitly casting them to an int. This addresses Mantis issue #502. library/string.m: Add a new alternative to the poly_type/0 type that wraps uint values. Update the documentation for string.format. uint values may now be formatted using the u, x, X, o or p conversion specifiers. library/string.format.m: Add the necessary machinery for handling formatting of uint values. library/string.parse_runtime.m: library/string.parse_util.m: Handle uint poly_types. library/io.m:a Handle uint values in the write_many predicates. library/pprint.m: Handle uint values in the poly/1 function. compiler/format_call.m: compiler/parse_string_format.m: Conform to the above changes. compiler/options.m: Add a way to detect if a compiler supports this change. NEWS: Announce the above changes. tests/hard_coded/stream_format.{m,exp}: Extend this test to cover uints. tests/invalid/string_format_bad.m: tests/invalid/string_format_unknown.m: Conform to the above changes. tests/string_format/Mmakefile: tests/string_format/string_format_uint_o.{m,exp,exp2}: tests/string_format/string_format_uint_u.{m,exp,exp2}: tests/string_format/string_format_uint_x.{m,exp,exp2}: Add tests of string.format with uints.
This commit is contained in:
1975
tests/string_format/string_format_uint_u.exp
Normal file
1975
tests/string_format/string_format_uint_u.exp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user