Commit graph

201 commits

Author SHA1 Message Date
Richard (Rikki) Andrew Cattermole
205256abb1
Fix #10699 - std.format with position with omitted second number does not work (#10716) 2025-03-28 01:49:06 -07:00
Richard (Rikki) Andrew Cattermole
c64232d813
Fix #10713 - std.format string positions affect all further format specifiers (#10714) 2025-03-25 16:10:34 +08:00
Nicolò Monaldini
0d724aa0c8
Fix %*s handling by formattedRead() (#10654) 2025-03-03 06:59:08 +08:00
Iain Buclaw
7be45e8e01 unittest: Don't run x87 log2 test on 64-bit real targets 2025-01-19 15:45:14 +01:00
John Dougan
9e7d2f37cf
Fix typos in compound format descriptions (#10572)
Someone tried to \( instead of $(LPAREN) inside of a bold macro. Didn't work and made the description very misleading.
2024-12-04 08:32:35 +08: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
João Lourenço
6b666971bc
Add 'std.format.read.formattedRead' overloads to return a Tuple with values read (#8647)
* refactor(formattedRead): add not is type validation to template argument 'fmt'

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* feat(formattedRead): add overloads to return a tuple with the read values

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* test(formattedRead): add unnittests for the tuple return type overloads

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* chore(changelog): add a changelog formattedRead entry

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

---------

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2024-11-25 20:43:04 -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
Nick Treleaven
61bd59c669
[std.format] Add anchors for section headings (#9054) 2024-10-02 16:54:07 +03:00
0-v-0
59200013b3
Remove std.conv import from skipData (#9040) 2024-08-07 17:21:24 +03:00
Jeremy Baxter
f176df8475 fix ddoc blunders
Caught with grep -Er '\(\$[A-Za-z]'
2024-07-08 08:09:37 +08:00
0-v-0
d8e8f1f351 Remove std.conv import from quickSortImpl 2024-06-22 11:07:40 +08:00
0-v-0
42e2caa5c0 Improve code readablitity in unittests 2024-06-21 18:35:03 +02: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
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