Skip to content

Commit bf0dd31

Browse files
committed
Fix markdown code block wrapping which was causing pdf font issues round 2
1 parent 2c6d215 commit bf0dd31

10 files changed

+170
-196
lines changed

CLAUDE.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Rules for all work on WG21 papers in this repository.
9696
summarize arithmetic or data
9797
30. Align trailing comment columns when consecutive lines have
9898
trailing comments
99-
31. Fenced code blocks must not exceed 80 characters per
99+
31. Fenced code blocks must not exceed 90 characters per
100100
line. This rule does not apply to mermaid blocks -
101101
never reformat mermaid source. When wrapping is
102102
needed, follow the conventions for the block's
@@ -114,23 +114,27 @@ Rules for all work on WG21 papers in this repository.
114114
- Trailing comments: shorten the gap between code and
115115
comment rather than wrapping the code, but keep
116116
grouped comments aligned with each other (rule 30)
117-
- If shortening the gap is not enough, move the
118-
comment to the line above the code it describes
117+
- If a trailing comment still exceeds 90 characters
118+
after tightening the gap, wrap the comment text to
119+
a second line. The continuation `//` must align
120+
with the `//` on the first line. Never move a
121+
trailing comment above the code line - keep all
122+
comments in a contiguous block on the right
119123

120124
**Prose in code fences** (markdown, plain text) -
121125
wrap at word boundaries with no continuation indent
122126

123127
## Structure
124128

125-
31. Sections with subsections should have at least one introductory
129+
32. Sections with subsections should have at least one introductory
126130
sentence between the section heading and the first subsection
127131
heading - do not leave an empty section heading
128-
32. Every paper must contain a `## Revision History` section,
132+
33. Every paper must contain a `## Revision History` section,
129133
placed immediately after the Abstract's trailing `---` and
130134
before Section 1. Each revision is an H3 subheading in the
131135
form `### R<n>: <Month> <Year> (<pre-Meeting mailing>)`
132136
followed by a bullet list of changes
133-
33. References and citations - for readers of printed copies:
137+
34. References and citations - for readers of printed copies:
134138
- Every hyperlink in the document body must also appear
135139
in the References section
136140
- Every hyperlink in the document body must have a
@@ -156,10 +160,10 @@ Rules for all work on WG21 papers in this repository.
156160

157161
## Tone
158162

159-
34. Do not present options as predetermined conclusions. When
163+
35. Do not present options as predetermined conclusions. When
160164
recommending alternatives to a committee, present them as options
161165
to contemplate, not dictated outcomes
162-
35. Avoid politically charged comparisons - do not invoke other
166+
36. Avoid politically charged comparisons - do not invoke other
163167
contentious features as analogies unless the comparison is
164168
structurally precise. If the structures being compared are
165169
fundamentally different, the analogy will be perceived as

d4003-coroutine-io.html

Lines changed: 35 additions & 42 deletions
Large diffs are not rendered by default.

d4003-coroutine-io.pdf

-338 Bytes
Binary file not shown.

d4007-senders-and-coros.html

Lines changed: 45 additions & 54 deletions
Large diffs are not rendered by default.

d4007-senders-and-coros.pdf

-1.1 KB
Binary file not shown.

d4014-sender-sub-language.html

Lines changed: 32 additions & 31 deletions
Large diffs are not rendered by default.

d4014-sender-sub-language.pdf

-966 Bytes
Binary file not shown.

source/d4003-coroutine-io.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ struct my_awaitable
158158
159159
// This signature satisfies IoAwaitable
160160
std::coroutine_handle<>
161-
await_suspend( std::coroutine_handle<> cont,
162-
io_env const* env )
161+
await_suspend( std::coroutine_handle<> cont, io_env const* env )
163162
{
164163
cont_ = cont;
165164
env_ = env;
@@ -307,8 +306,7 @@ struct task
307306
308307
// Satisfies IoAwaitable
309308
std::coroutine_handle<>
310-
await_suspend( std::coroutine_handle<> cont,
311-
io_env const* env )
309+
await_suspend( std::coroutine_handle<> cont, io_env const* env )
312310
{
313311
h_.promise().set_continuation( cont );
314312
h_.promise().set_environment( env );
@@ -438,12 +436,11 @@ A launch function (e.g., `run_async`, `run`) bridges non-coroutine code into the
438436

439437
```cpp
440438
template<Executor Ex, class... Args>
441-
// returns wrapper, caller invokes with task
442-
unspecified run_async( Ex ex, Args&&... args );
439+
unspecified run_async( Ex ex, Args&&... args ); // returns wrapper,
440+
// caller invokes with task
443441

444442
template<Executor Ex, class... Args>
445-
// returns wrapper for co_await
446-
unspecified run( Ex ex, Args&&... args );
443+
unspecified run( Ex ex, Args&&... args ); // returns wrapper for co_await
447444
```
448445
449446
**Requirements:**
@@ -600,8 +597,7 @@ concept ExecutionContext =
600597
requires(X& x) {
601598
typename X::executor_type;
602599
requires Executor<typename X::executor_type>;
603-
{ x.get_executor() } noexcept
604-
-> std::same_as<typename X::executor_type>;
600+
{ x.get_executor() } noexcept -> std::same_as<typename X::executor_type>;
605601
};
606602
```
607603
@@ -629,8 +625,7 @@ Coroutine frame allocation has a fundamental timing constraint: `operator new` e
629625
auto t = my_coro(sock); // operator new called HERE
630626
co_await t; // await_transform kicks in HERE (too late)
631627
632-
// my_coro(sock) evaluated BEFORE calling spawn (too late)
633-
spawn( my_coro(sock) );
628+
spawn( my_coro(sock) ); // my_coro(sock) evaluated BEFORE calling spawn (too late)
634629
```
635630
636631
### 5.2 The Awkward Approach
@@ -1270,9 +1265,7 @@ concept io_runnable =
12701265
requires { typename T::promise_type; } &&
12711266
requires(T& t, T const& ct, typename T::promise_type const& cp,
12721267
typename T::promise_type& p) {
1273-
{ ct.handle() } noexcept
1274-
-> same_as<coroutine_handle<
1275-
typename T::promise_type>>;
1268+
{ ct.handle() } noexcept -> same_as<coroutine_handle<typename T::promise_type>>;
12761269
{ cp.exception() } noexcept -> same_as<exception_ptr>;
12771270
{ t.release() } noexcept;
12781271
{ p.set_continuation(coroutine_handle<>{}) } noexcept;

source/d4007-senders-and-coros.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ read(tcp::socket& sock)
164164
char buf[1024];
165165
for (;;)
166166
{
167-
auto [ec, n] = co_await sock.read_some(buf); // also a tuple
168-
// n bytes arrived regardless of ec
169-
result.append(buf, n);
167+
auto [ec, n] = co_await sock.read_some(buf); // also a tuple
168+
result.append(buf, n); // n bytes arrived regardless of ec
170169
if (ec)
171170
co_return {ec, std::move(result)};
172171
}
@@ -207,14 +206,14 @@ sender_of<dynamic_buffer> auto async_read_array(auto handle) {
207206
return just(std::as_writeable_bytes(std::span(&buf.size, 1)))
208207
| async_read(handle)
209208
| then(
210-
[&buf] (std::size_t bytes_read) { // from set_value
209+
[&buf] (std::size_t bytes_read) { // from set_value
211210
assert(bytes_read == sizeof(buf.size));
212211
buf.data = std::make_unique<std::byte[]>(buf.size);
213212
return std::span(buf.data.get(), buf.size);
214213
})
215214
| async_read(handle)
216215
| then(
217-
[&buf] (std::size_t bytes_read) { // from set_value
216+
[&buf] (std::size_t bytes_read) { // from set_value
218217
assert(bytes_read == buf.size);
219218
return std::move(buf);
220219
});
@@ -413,7 +412,7 @@ do_read(tcp_socket& s, buffer& buf)
413412
{
414413
auto [ec, n] = co_await s.async_read(buf);
415414
if (ec)
416-
co_yield with_error(ec); // unfortunately, terminates the coroutine
415+
co_yield with_error(ec); // unfortunately, terminates the coroutine
417416
co_return n;
418417
}
419418
```
@@ -527,10 +526,8 @@ recycling_allocator<> alloc;
527526
auto op = connect(
528527
write_env(
529528
ex::on(sch,
530-
// operator new allocates here...
531-
handle_connection(std::move(conn))),
532-
// ...but allocator arrives here
533-
prop(get_allocator, alloc)),
529+
handle_connection(std::move(conn))), // operator new allocates here...
530+
prop(get_allocator, alloc)), // ...but allocator arrives here
534531
rcvr);
535532
start(op);
536533
```
@@ -878,15 +875,10 @@ struct read_op
878875
{
879876
struct recv_rcvr {
880877
read_op* self_;
881-
void set_value(std::size_t n) && noexcept {
882-
self_->completed({}, n);
883-
}
884-
void set_error(std::error_code ec) && noexcept {
885-
self_->completed(ec, 0);
886-
}
878+
void set_value(std::size_t n) && noexcept { self_->completed({}, n); }
879+
void set_error(std::error_code ec) && noexcept { self_->completed(ec, 0); }
887880
void set_stopped() && noexcept {
888-
execution::set_stopped(
889-
std::move(self_->rcvr_));
881+
execution::set_stopped(std::move(self_->rcvr_));
890882
}
891883
};
892884

@@ -912,8 +904,7 @@ struct read_op
912904
return execution::set_value(std::move(rcvr_), bytes_read_);
913905
if (!ec)
914906
return start_recv();
915-
// bytes_read_ bytes are lost
916-
execution::set_error(std::move(rcvr_), ec);
907+
execution::set_error(std::move(rcvr_), ec); // bytes_read_ bytes are lost
917908
}
918909
};
919910
```

source/d4014-sender-sub-language.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ struct fold_left_fn {
312312
I i = first;
313313
return (*this)(++i, last, u, f); // recursive Kleisli composition
314314
});
315-
return std::move(nxt); // inductive case: bind + recurse
315+
return std::move(nxt); // inductive case: bind + recurse
316316
}
317317
};
318318
```
@@ -336,16 +336,16 @@ The `any_sender_of` type is provided by the [stdexec](https://github.com/NVIDIA/
336336
The following example is drawn from [backtrack.cpp](https://github.com/steve-downey/sender-examples/blob/main/src/examples/backtrack.cpp)<sup>[31]</sup> in the sender-examples repository:
337337

338338
```cpp
339-
auto search_tree(auto test, // predicate
340-
tree::NodePtr<int> tree, // current node
341-
stdexec::scheduler auto sch, // execution context
342-
any_node_sender&& fail) // the continuation (failure recovery)
339+
auto search_tree(auto test, // predicate
340+
tree::NodePtr<int> tree, // current node
341+
stdexec::scheduler auto sch, // execution context
342+
any_node_sender&& fail) // the continuation (failure recovery)
343343
-> any_node_sender { // type-erased monadic return
344344
if (tree == nullptr) {
345345
return std::move(fail); // invoke the continuation
346346
}
347347
if (test(tree)) {
348-
return stdexec::just(tree); // pure/return: lift into context
348+
return stdexec::just(tree); // pure/return: lift into context
349349
}
350350
return stdexec::on(sch, stdexec::just()) // schedule on executor
351351
| stdexec::let_value( // monadic bind (>>=)
@@ -361,7 +361,8 @@ auto search_tree(auto test, // predicate
361361
test,
362362
tree->right(), // with failure continuation
363363
sch,
364-
std::move(fail)); // continuation-passing failure recovery
364+
std::move(fail)); // continuation-passing
365+
// failure recovery
365366
}));
366367
});
367368
}
@@ -387,7 +388,7 @@ The following example is drawn from [retry.hpp](https://github.com/NVIDIA/stdexe
387388
```cpp
388389
// Deferred construction helper - emplaces non-movable types
389390
// into std::optional via conversion operator
390-
template <std::invocable Fun> // higher-order function wrapper
391+
template <std::invocable Fun> // higher-order function wrapper
391392
requires std::is_nothrow_move_constructible_v<Fun>
392393
struct _conv {
393394
Fun f_; // stored callable
@@ -410,7 +411,7 @@ struct _retry_receiver // receiver adaptor pa
410411
_retry_receiver<S, R>> {
411412
_op<S, R>* o_; // pointer to owning op state
412413

413-
auto base() && noexcept -> R&& { // access inner receiver (rvalue)
414+
auto base() && noexcept -> R&& { // access inner receiver (rvalue)
414415
return static_cast<R&&>(o_->r_);
415416
}
416417
auto base() const& noexcept -> const R& { // access inner receiver (const)
@@ -429,31 +430,31 @@ struct _retry_receiver // receiver adaptor pa
429430
// and re-constructed on each retry
430431
template <class S, class R>
431432
struct _op {
432-
S s_; // the sender to retry
433-
R r_; // the downstream receiver
434-
std::optional< // optional nested op state
435-
stdexec::connect_result_t< // type of connect(S, retry_rcvr)
436-
S&, _retry_receiver<S, R>>> o_; // re-created on each retry
433+
S s_; // the sender to retry
434+
R r_; // the downstream receiver
435+
std::optional< // optional nested op state
436+
stdexec::connect_result_t< // type of connect(S, retry_rcvr)
437+
S&, _retry_receiver<S, R>>> o_; // re-created on each retry
437438

438-
_op(S s, R r) // construct from sender + receiver
439+
_op(S s, R r) // construct from sender + receiver
439440
: s_(static_cast<S&&>(s))
440441
, r_(static_cast<R&&>(r))
441442
, o_{_connect()} {} // initial connection
442443

443444
_op(_op&&) = delete; // immovable (stable address)
444445

445-
auto _connect() noexcept { // connect sender to retry receiver
446-
return _conv{[this] { // deferred construction via _conv
447-
return stdexec::connect( // connect sender
448-
s_, // to retry receiver
449-
_retry_receiver<S, R>{this}); // that points back to this op
446+
auto _connect() noexcept { // connect sender to retry receiver
447+
return _conv{[this] { // deferred construction via _conv
448+
return stdexec::connect( // connect sender
449+
s_, // to retry receiver
450+
_retry_receiver<S, R>{this}); // that points back to this op
450451
}};
451452
}
452453

453454
void _retry() noexcept { // retry: destroy and reconnect
454455
STDEXEC_TRY {
455-
o_.emplace(_connect()); // re-emplace the operation state
456-
stdexec::start(*o_); // restart the operation
456+
o_.emplace(_connect()); // re-emplace the operation state
457+
stdexec::start(*o_); // restart the operation
457458
}
458459
STDEXEC_CATCH_ALL { // if reconnection itself throws
459460
stdexec::set_error( // propagate to downstream
@@ -477,15 +478,15 @@ struct _retry_sender {
477478
explicit _retry_sender(S s) // construct from inner sender
478479
: s_(static_cast<S&&>(s)) {}
479480

480-
template <class> // completion signature transform:
481-
using _error = stdexec::completion_signatures<>; // remove all error signatures
481+
template <class> // completion signature transform:
482+
using _error = stdexec::completion_signatures<>; // remove all error signatures
482483

483484
template <class... Args>
484485
using _value = // pass through value signatures
485486
stdexec::completion_signatures<
486487
stdexec::set_value_t(Args...)>;
487488

488-
template <class Self, class... Env> // compute transformed signatures
489+
template <class Self, class... Env> // compute transformed signatures
489490
static consteval auto get_completion_signatures()
490491
-> stdexec::transform_completion_signatures< // signature transformation
491492
stdexec::completion_signatures_of_t<S&, Env...>, // from inner sender's sigs
@@ -569,7 +570,7 @@ auto schedule() const noexcept {
569570
570571
```cpp
571572
// From nvexec/stream/common.cuh - CUDA kernel launch syntax
572-
continuation_kernel<<<1, 1, 0, get_stream()>>>( // <<<grid, block, smem, stream>>>
573+
continuation_kernel<<<1, 1, 0, get_stream()>>>( // <<<grid, block, smem, stream>>>
573574
static_cast<R&&>(rcvr_), Tag(), static_cast<Args&&>(args)...);
574575
```
575576

0 commit comments

Comments
 (0)