Commit graph

96 commits

Author SHA1 Message Date
Akshat(DeterminedSage)
e49833dfd2 fix: give compile error for infinite range in format
Tackled the issue of infinite loop during runtime when providing
format with infinte range . Now it shows compilation error for
the same .

fixes : #10559
2025-04-17 21:01:24 +05:30
Iain Buclaw
7be45e8e01 unittest: Don't run x87 log2 test on 64-bit real targets 2025-01-19 15:45:14 +01:00
Dennis
600c721875
Fixes for -preview=rvaluerefparam (#9092)
* Update `hasToString` for `-preview=rvaluerefparam`

* Remove ref parameter test of parse()
2024-11-26 22:29:24 -08:00
Vladiwostok
231ae8b68a
Fix D-Scanner linting issues (#9070)
* Fix UndocumentedDeclarationCheck linting issue

* Fix IfConstraintsIndentCheck linting issue

* Address feedback

* Fix publictests CI

* Fix old (libdparse) D-Scanner linting warn
2024-10-27 01:21:56 -07:00
Dennis
13816d78f3
Reduce imports needed to print floats (#8890) 2024-01-10 17:46:22 +02:00
Dennis Korpel
3b383798dd Fix unsafe union access in std.format 2023-07-27 20:26:20 +02:00
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
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
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
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
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
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
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
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
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
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
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
3bff76a820 std.format: formatting floating points is meanwhile pure 2021-05-08 21:23:57 +02:00
berni44
430d506d35 Fix Issue 21900 - std.format: round to even does not work for hex integers with letters 2021-05-07 15:24:27 +02:00
Razvan Nitu
b78773c5a4
Merge pull request #8015 from berni44/add_integer_efga
std.format: Add formatting integers with %e, %f, %g and %a.
2021-05-07 14:59:25 +08:00
berni44
03447d6cc7 Fix Issue 21808 - std.format: It should be possible to change the order of key and value of AAs. 2021-05-05 09:12:40 +02:00
berni44
6d5d3e6f0e std.format: handle "exotic" reals by casting to double 2021-05-03 12:29:15 +02:00
berni44
dbfb742ccd Fix Issue 21875 - std.format: wrong number of format specifiers in
nested format string of associative arrays should be detected
2021-04-29 15:26:05 +02:00
berni44
3206e52aae Clean up after making formating floating point numbers @nogc. 2021-04-27 13:18:11 +02:00
berni44
99cbab9584 Fix Issue 21858 - std.format: centering output 2021-04-26 19:20:41 +02:00
berni44
5fbc1da0fa Fix Issue 21847 - std.format: %e, %g and %a should be supported for integers too 2021-04-26 17:10:05 +02:00
berni44
ad5247072f std.format: Add formatting integers with %e, %f, %g and %a. 2021-04-26 16:28:00 +02:00
berni44
edb1237abc Add rounding tool. 2021-04-26 16:28:00 +02:00
The Dlang Bot
fe172268e8
Merge pull request #8007 from berni44/float_f_nogc
std.format: Make formatting %f (and %g partly) 100% @nogc.
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2021-04-24 12:55:55 +02:00
The Dlang Bot
6b14e37a4c
Merge pull request #8006 from berni44/float_e_nogc
std.format: Make formatting %e (and partly %g) 100% @nogc.
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2021-04-24 12:12:43 +02:00