Commit graph

186 commits

Author SHA1 Message Date
Dennis
5cd77a6e32
User hyperlinks to refer to bugzilla issues (#8766) 2023-06-16 14:45:44 +03:00
Geod24
2e8f217ae9 Change how preview=in is detected
This is a minor internal change, but will allow us to deprecate in ref at the parser level.
2023-02-28 12:56:43 +01:00
RazvanN7
61658d2372 Remove alias this from classes in phobos 2023-01-26 14:35:08 +02:00
João Lourenço
7cc45a81df
test(format.read): add formattedRead compile-time format string overload with Tuple arguments unit tests
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2023-01-05 18:39:30 +00:00
João Lourenço
c4192e855e
fix(format.read): formattedRead incorrectly static asserts with Tuple and compile-time format string
This method supports std.typecons.Tuple, however, when passing the
format string at compile-time, the format validation does not correctly
account for the std.typecons.Tuple's types and instead validates the
std.typecons.Tuple itself leading to a static assert.

This change now adds support for this feature when used with
compile-time format strings.

Fix Issue #23600

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2023-01-05 18:39:18 +00:00
aG0aep6G
26c7f44de8 fix issue 23488 - std.format.sformat mishandles char ranges 2022-11-15 21:10:14 +01:00
Lucian Danescu
8293310cd8 rename variables 2022-11-09 23:28:55 +02:00
Lucian Danescu
452b1def78 same name fix 2022-11-07 19:20:19 +02:00
Per Nordlöw
b9ba6c2d97 Merge remote-tracking branch 'upstream/master' into avoid-EnumMembers-in-formatValueImpl-enum 2022-11-02 13:16:32 +01:00
Iain Buclaw
e99ec12056
Merge pull request #8618 from ibuclaw/merge_stable
merge stable
2022-11-01 14:58:25 +01:00
Iain Buclaw
a2c7d6d7e9 Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-11-01 11:40:20 +00:00
Bastiaan Veelo
afda65c58e
Clarify the format flags documentation. (#8612)
* Clarify the format flags documentation.

Resolve a `then`/`than` error and focus on what the flag does instead of on the default behaviour when the flag is absent. This way the descriptions for the `-` and `=` flags are more in line.
2022-10-19 05:37:49 +08:00
Paul Backus
94fa37f2bf Fix issue 23400 - Can't format enum value whose base type has non-const opEquals 2022-10-16 17:46:21 -04:00
Per Nordlöw
829afd9783 Merge remote-tracking branch 'upstream/master' into reduce-put-in-formatValueImpl-enum 2022-10-14 10:06:31 +02:00
Per Nordlöw
b1c705c697
Use early return in formatValueImpl to reduce indentation (#8600) 2022-10-14 06:19:02 +08:00
Per Nordlöw
3cada1e3c2 Avoid two calls to put in enum overload of formatValueImpl 2022-10-12 09:10:02 +02:00
Per Nordlöw
1b6b22eab3 Remove variable members in formatValueImpl 2022-10-12 07:07:42 +02:00
Paul Backus
53240af537
Use __traits(identifier) to format enum member (#8594)
No behavioral change, but simplifies the code.
2022-10-12 05:57:34 +08:00
Per Nordlöw
5fa1eb3442 Avoid use of EnumMembers in enum specialization of formatValueImpl 2022-10-11 14:37:19 +02:00
Paul Backus
5b8749ca7c Fix issue 23324 - Incorrect source link in std.format docs 2022-09-05 00:26:06 +02:00
Paul Backus
223b82ac26 Fix 23246 - std.format ignores non-const toString method of associative array value 2022-07-13 15:47:33 -04:00
Paul Backus
e1ba05dab1 Fix 23245 - std.format ignores non-const toString method of static array element 2022-07-13 15:46:29 -04:00
Martin Nowak
0e3efabacc Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-04-01 10:23:49 +02:00
Dennis Korpel
ba92563a0d Fix issue 22939 - bad error message: Error: no property msg for type string 2022-03-29 18:51:30 +00:00
Paul Backus
fc8f333ca3
Fix issue 22873 - Wrong std.format output for inout (#8409)
Fix issue 22873 - Wrong std.format output for `inout`

Signed-off-by: Steven Schveighoffer <schveiguy@users.noreply.github.com>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2022-03-22 13:32:02 +00:00
Gabriel Dolberg
67c546a828 ✏️ fix typos in docs 2022-01-05 22:09:24 +00:00
wolframw
4687883231 Fix Issue 18051 - missing enum support in formattedRead/unformatValue 2021-12-31 10:28:04 +00:00
Per Nordlöw
495e835c2d Add unittest for issue 22609 2021-12-20 00:36:36 +00:00
Per Nordlöw
4b5785c4e3 Reduce template bloat in IntegralTypeOf-overload of formatValueImpl 2021-10-22 09:37:40 +00:00
Per Nordlöw
dd310f3543 Use string compile-time concatenation assigned to enums then passed to put()
Reverts https://github.com/dlang/phobos/pull/8277/files.
2021-10-15 09:16:21 +00:00
Per Nordlöw
0812f7a4e0 Avoid string concatenations in put() calls to avoid GC allocations 2021-10-14 18:26:14 +00:00
Per Nordlöw
46d416fa9d Qualify some function parameters under std.format as const to reduce template bloat 2021-09-22 23:12:15 +00:00
Ramanuj
afb382485b
Fix Issue 20393 - formattedRead accepts input, that should be rejected (#8144) 2021-06-16 16:08:53 +08:00
Martin Nowak
7a461990da Merge remote-tracking branch 'upstream/stable' into merge_stable 2021-06-04 13:02:58 +02:00
Martin Kinkelin
679521d44e std.format.internal.floats: Restore compilability of unittests for targets with quadruple real precision
Such as non-Apple AArch64; `printFloat()` doesn't support that format.
2021-06-03 07:56:06 +00:00
Martin Nowak
14f71b32fa Merge remote-tracking branch 'upstream/stable' into merge_stable 2021-05-28 13:04:01 +02:00
Martin Kinkelin
8f262acda1 std.format.internal.write: Replace brittle runtime check by compile-time check
When checking whether `T.toString` for some class `T` is inherited from
base class `Object`.

The runtime check fails when using a druntime DLL on Windows, where
`Object.toString` in other DLLs/executables is a trampoline (in the
druntime import library) to the dllimported function, with its own
identity.
2021-05-23 15:42:44 +02:00
berni44
85afd3555f std.format: Clean up rounding of floats. 2021-05-20 17:59:09 +08:00
Razvan Nitu
16d01b0d14
Merge pull request #8073 from berni44/rounding_f
std.format: Use rounding tool to round %f on floats.
2021-05-20 14:31:59 +08:00
Iain Buclaw
116d33b635 Revert "Fix Issue 9489 - writeln of struct with disabled copy ctor"
This reverts commit 838da632cb.
2021-05-17 23:03:37 +02:00
berni44
9205a37823 std.format: Use rounding tool to round %f on floats. 2021-05-14 20:56:30 +02:00
Razvan Nitu
d154c239c4
Merge pull request #8050 from berni44/rounding_e
std.format: Use rounding tool to round %e on floats.
2021-05-14 14:38:42 +08:00
Razvan Nitu
dba3cbc88c
Merge pull request #8059 from berni44/rounding_a
std.format: Use rounding tool to round %a on floats.
2021-05-13 14:35:19 +08:00
Vladimir Panteleev
28b9d08fa2 Fix Issue 21916 - Error message is obfuscated when using wrong format specifier at compile-time 2021-05-13 02:22:27 +02:00
berni44
838da632cb Fix Issue 9489 - writeln of struct with disabled copy ctor 2021-05-12 09:41:58 +02:00
berni44
3b4dc67878 Make unittests in std.format @safe 2021-05-11 16:13:09 +02:00
berni44
36221cf4cc Revert "Fix Issue 21456 - std.format does not accept enum member with string base type as template parameter"
This reverts commit 974a88a967.
2021-05-10 18:30:05 +02:00
berni44
73b1ab5f9d std.format: Use rounding tool to round %a on floats. 2021-05-10 10:37:03 +02:00
Razvan Nitu
f33b92f74f
Merge pull request #8049 from berni44/issue_21900
Fix Issue 21900 - std.format: round to even does not work for hex integers with letters
2021-05-10 15:50:30 +08:00
berni44
6bcc66a071
std.format: Remove outdated printFloatTest (#8054) 2021-05-09 21:37:08 +08:00