Commit graph

5 commits

Author SHA1 Message Date
Marcus Klaas 0e0cf976c9 Fix issues with empty macros with curly braces 2016-03-27 13:44:40 +02:00
Kevin Yeh 7fc70a1753 Add item macro tests 2016-01-24 13:11:18 -06:00
Kevin Yeh f01ed6f507 Format item macros 2016-01-22 13:43:18 -06: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
Marcus Klaas f751356910 Format macro invocations 2015-09-16 20:26:14 +02:00