about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
AgeCommit message (Collapse)AuthorLines
2019-07-12Use snippet instead of pprinting statementEsteban Küber-2/+1
2019-07-11Address review commentsVadim Petrochenkov-9/+10
2019-07-11pretty-print: Merge `print_tts` and `print_tts_ext`Vadim Petrochenkov-10/+6
2019-07-11pretty-print: Do not lose the `$crate` printing flag in `print_tt`Vadim Petrochenkov-1/+1
2019-07-10File is now short enough for tidyMark Rousskov-2/+0
2019-07-10Remove writer function from PrintStateMark Rousskov-37/+32
2019-07-10Use constant instead of magic numberMark Rousskov-1/+1
2019-07-10Remove needless indent argumentsMark Rousskov-11/+8
We're always indenting by INDENT_UNIT anyway
2019-07-10Move pp::Printer helpers to direct implMark Rousskov-42/+12
2019-07-10Rename is_bol -> is_beginning_of_lineMark Rousskov-9/+4
Also moves it to pp::Printer from PrintState.
2019-07-10Remove needless indirection in bcloseMark Rousskov-6/+2
2019-07-10Drop length from Token::StringMark Rousskov-1/+1
It was always set to the string's length
2019-07-10Remove is_begin/is_end functions from PrintStateMark Rousskov-16/+4
These are somewhat ambiguous (beginning/end of what?) so it's better to inline their one use into the code.
2019-07-10Move pp::Printer out field to owned StringMark Rousskov-19/+13
This enforces that eof() must be called to get the String out, and generally is better from an API perspective. No users of pretty printing pre-allocate the buffer.
2019-07-10Inline State::new_from_input in pprustMark Rousskov-18/+6
This function took too many arguments and are simple on the inside; inlining them makes complexity go down. hir::print's copy is unfortunately used from librustc_driver so inlining it is not as straightforward.
2019-07-10print_crate returns String instead of taking an out pointerMark Rousskov-4/+5
2019-07-10Replace src: &mut dyn Read with StringMark Rousskov-3/+2
2019-07-10Combine comment-handling logic into structMark Rousskov-37/+57
This also permits sharing the underlying code between pprust and hir::print.
2019-07-10Inline State::newMark Rousskov-9/+1
There was only one callsite for each and this removes the unwrap_or_default's on the comments argument
2019-07-10Stop Option-wrapping commentsMark Rousskov-14/+10
We always check against the length before indexing anyway.
2019-07-10Remove unused boxes vectorMark Rousskov-12/+0
2019-07-10Privatize and remove unused functionsMark Rousskov-19/+9
2019-07-10Move lifetime_to_string to Display implMark Rousskov-4/+0
2019-07-10Remove unused arm_to_stringMark Rousskov-4/+0
2019-07-10Remove duplicate attr_to_stringMark Rousskov-4/+0
attribute_to_string exists.
2019-07-10Move literal_to_string to fmt::DisplayMark Rousskov-5/+1
2019-07-09Pretty-print `$crate` as `crate`/`::my_crate` in tokensVadim Petrochenkov-47/+62
...but only if those tokens are printed from inside of AST pretty-printing.
2019-06-29Inline rust_printerMark Rousskov-14/+9
2019-06-29Remove unused importMark Rousskov-1/+0
2019-06-29Remove io::Result from syntax::printMark Rousskov-1102/+1038
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-29Replace pretty-printer Box<dyn Write> with &mut StringMark Rousskov-12/+10
2019-06-29Delete now-unused methodsMark Rousskov-49/+0
2019-06-29Privatize a bunch of methodsMark Rousskov-72/+72
2019-06-24Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkovbors-8/+4
Remove `ast::Guard` With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here. However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...). r? @petrochenkov
2019-06-23Remove redundant syntax::ast::Guard.Mazdak Farrokhzad-8/+4
2019-06-23let_chains: Fix bugs in pretty printing.Mazdak Farrokhzad-12/+28
2019-06-23let_chains: Handle it in AST pretty printing.Mazdak Farrokhzad-40/+14
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-1/+0
Also give them a span in the HIR
2019-06-08syntax: Remove `Deref` impl from `Token`Vadim Petrochenkov-4/+8
2019-06-07syntax: Treat error literals in more principled wayVadim Petrochenkov-4/+4
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-4/+4
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-2/+2
2019-06-05Implemented for function bounds, type bounds, and named existential types.Alexander Regueiro-4/+11
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-4/+4
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-11/+12
Here follows the main reverts applied in order to make this commit: Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj" This reverts commit 45b09453dbf120cc23d889435aac3ed7d2ec8eb7, reversing changes made to f6df1f6c30b469cb9e65c5453a0efa03cbb6005e. Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis" This reverts commit 16939a50ea440e72cb6ecefdaabb988addb1ec0e, reversing changes made to 12bf98155249783583a91863c5dccf9e346f1226. Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj" This reverts commit 62d1574876f5531bce1b267e62dff520d7adcbbb, reversing changes made to 4eff8526a789e0dfa8b97f7dec91b7b5c18e8544.
2019-05-24Remove `ObsoleteInPlace`varkor-7/+0
2019-05-23syntax: Some code cleanupVadim Petrochenkov-1/+2
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-18/+18
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-7/+7
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-3/+3