-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pretty printer improvements #14106
Pretty printer improvements #14106
Commits on May 13, 2014
-
rustc: Make std_inject valid for pretty-printer
Inject `extern crate {std, native}` before `use` statements. Add `#![feature(glob)]` since `use std::prelude::*` is used. (Unfortunately `rustc --pretty expanded` does not converge, since `extern crate` and `use std::prelude::*` is injected at every iteration.)
Configuration menu - View commit details
-
Copy full SHA for c07cc84 - Browse repository at this point
Copy the full SHA c07cc84View commit details -
pprust: Add parentheses to some Expr
Some `Expr` needs parentheses when printed. For example, without parentheses, `ExprUnary(UnNeg, ExprBinary(BiAdd, ..))` becomes `-lhs + rhs` which is wrong. Those cases don't appear in ordinary code (since parentheses are explicitly added) but they can appear in manually crafted ast by extensions.
Configuration menu - View commit details
-
Copy full SHA for 2ede3e3 - Browse repository at this point
Copy the full SHA 2ede3e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f4c5e9 - Browse repository at this point
Copy the full SHA 0f4c5e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19d54d8 - Browse repository at this point
Copy the full SHA 19d54d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cdb5c3e - Browse repository at this point
Copy the full SHA cdb5c3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ec9f1f0 - Browse repository at this point
Copy the full SHA ec9f1f0View commit details -
test: Add missing
#![feature(managed_boxes)]
The tests use managed boxes, but are not perfectly feature-gated because they use `@` inside macros. (It causes issue after `--pretty expanded`.)
Configuration menu - View commit details
-
Copy full SHA for 536ef8a - Browse repository at this point
Copy the full SHA 536ef8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3e7bfa - Browse repository at this point
Copy the full SHA f3e7bfaView commit details -
compiletest: Test
--pretty expanded
After testing `--pretty normal`, it tries to run `--pretty expanded` and typecheck output. Here we don't check convergence since it really diverges: for every iteration, some extra lines (e.g.`extern crate std`) are inserted. Some tests are `ignore-pretty`-ed since they cause various issues with `--pretty expanded`.
Configuration menu - View commit details
-
Copy full SHA for 05d3dbd - Browse repository at this point
Copy the full SHA 05d3dbdView commit details -
Touch up and rebase previous commits
* Added `// no-pretty-expanded` to pretty-print a test, but not run it through the `expanded` variant. * Removed #[deriving] and other expanded attributes after they are expanded * Removed hacks around &str and &&str and friends (from both the parser and the pretty printer). * Un-ignored a bunch of tests
Configuration menu - View commit details
-
Copy full SHA for c7ff0e2 - Browse repository at this point
Copy the full SHA c7ff0e2View commit details -
syntax: Fix printing INT64_MIN
Integers are always parsed as a u64 in libsyntax, but they're stored as i64. The parser and pretty printer both printed an i64 instead of u64, sometimes introducing an extra negative sign.
Configuration menu - View commit details
-
Copy full SHA for d62cfe7 - Browse repository at this point
Copy the full SHA d62cfe7View commit details -
syntax: Fix parsing << with closure types
This uses the trick of replacing the << token with a < token to parse closure types correctly. Closes rust-lang#13324
Configuration menu - View commit details
-
Copy full SHA for 93edd7e - Browse repository at this point
Copy the full SHA 93edd7eView commit details -
test: Fix a pretty printing test
The pretty printer handles inlines comments quite badly
Configuration menu - View commit details
-
Copy full SHA for 72dbadc - Browse repository at this point
Copy the full SHA 72dbadcView commit details -
test: Ignore a pretty expanded failing test
When expanding, an extra unsafe block is generated which is currently not handled well.
Configuration menu - View commit details
-
Copy full SHA for 1aa7703 - Browse repository at this point
Copy the full SHA 1aa7703View commit details -
syntax: Print suffixed token literals correctly
Previously, literals "1i" were printed as "1". This fixes the numeric-method-autoexport test for pretty printing.
Configuration menu - View commit details
-
Copy full SHA for da5b6e5 - Browse repository at this point
Copy the full SHA da5b6e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cc3876 - Browse repository at this point
Copy the full SHA 4cc3876View commit details -
syntax: Preserve attributes in #[deriving]
Now that the #[deriving] attribute is removed, the raw_pointers_deriving lint was broken. This commit restores the lint by preserving lint attributes across #[deriving] to the implementations and using #[automatically_derived] as the trigger for activating the lint.
Configuration menu - View commit details
-
Copy full SHA for 4796b17 - Browse repository at this point
Copy the full SHA 4796b17View commit details -
syntax: Improve --pretty normal slightly
When printing doc comments, always put a newline after them in a macro invocation to ensure that a line-doc-comment doesn't consume remaining tokens on the line.
Configuration menu - View commit details
-
Copy full SHA for 5de4b87 - Browse repository at this point
Copy the full SHA 5de4b87View commit details