Commit graph

13 commits

Author SHA1 Message Date
Kamal Marhubi
8b601812a6 cleanup: Use const instead of static 2016-02-01 23:40:45 -05:00
Kevin Yeh
f01ed6f507 Format item macros 2016-01-22 13:43:18 -06:00
Seo Sanghyeon
17c8fb10ea Remove unused imports 2015-11-27 23:38:05 +09:00
Nick Cameron
56a765ef05 Rustup 2015-11-16 14:16:46 +13:00
Eli Friedman
1c235de97d Fix crash speculatively parsing macro arguments as expressions.
The problem is essentially that if we try to parse a token tree using a
CodeMap different from the one the tree was originally parsed with,
spans become nonsense. Since CodeMaps can't be cloned, we're basically
forced to use the original ParseSess for additional parsing.

Ideally, rustfmt would be a bit more clever and figure out how to parse
macro arguments based on the definition of the macro itself, rather than
just guessing that a particular token sequence looks like an expression,
but this is good enough for now.

Fixes #538.
2015-10-27 23:41:32 -07:00
Alex Crichton
579fb34417 Remove dependence on rustc/rustc_driver, use syntex
Instead just parse manually with the `syntex_syntax` crate which is a clone of
libsyntax on crates.io which builds on stable Rust.
2015-10-23 13:46:14 -07:00
Alex Crichton
36abfe5dc2 Remove usage of many unstable features
This removes usage of:

* PathExt
* split_last
* split_last_mut
* catch_panic

The catch_panic one was a little tricky as the ident interner needed to be
cloned across threads (a little unsafely), but it should otherwise be good to
go.
2015-10-23 13:46:14 -07:00
Marcus Klaas
a9bd695723 Format vec! macro using brackets 2015-10-16 22:55:42 +02:00
Marcus Klaas
8daf4c3a31 Prevent panics on list-like macro uses with trailing commas 2015-10-08 22:04:17 +02:00
Nick Cameron
99d71a164a Changes to source formatting 2015-09-26 13:58:12 +12:00
Robin Gloster
5e2633b742 adapt to rust sytax::ast::Mac changes 2015-09-23 18:31:31 +00:00
Pavel Sountsov
d4108a3029 Initial implementation of hard tab indentation. 2015-09-19 10:36:45 -07:00
Marcus Klaas
f751356910 Format macro invocations 2015-09-16 20:26:14 +02:00