diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-01 23:05:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-01 23:05:28 +0000 |
| commit | 34138379b5945616e51b3822769628b252c7a4f5 (patch) | |
| tree | cf8dfaef80cf25fd7e3cbdb09f7ea3a270979454 /src/test/codegen/src-hash-algorithm | |
| parent | 498224af18ab68a2c646e6f036946d678bd1752d (diff) | |
| parent | 493642ab3a28fc575f699ae381123e6e4f3cec39 (diff) | |
| download | rust-34138379b5945616e51b3822769628b252c7a4f5.tar.gz rust-34138379b5945616e51b3822769628b252c7a4f5.zip | |
Merge #11322
11322: Extract function also extracts comments r=Vannevelj a=Vannevelj Fixes #9011 The difficulty I came across is that the original assist works from the concept of a `ast::StmtList`, a node, but that does not allow me to (easily) represent comments, which are tokens. To combat this, I do a whole bunch of roundtrips: from the `ast::StmtList` I retrieve the `NodeOrToken`s it encompasses. I then cast all `Node` ones back to a `Stmt` so I can apply indentation to it, after which it is again parsed as a `NodeOrToken`. Lastly, I add a new `make::` api that accepts `NodeOrToken` rather than `StmtList` so we can write the comment tokens. Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
