Commit Graph

14 Commits

Author SHA1 Message Date
Huon Wilson
99dd5911a1 syntax: unify all MacResult's into a single trait.
There's now one unified way to return things from a macro, instead of
being able to choose the `AnyMacro` trait or the `MRItem`/`MRExpr`
variants of the `MacResult` enum. This does simplify the logic handling
the expansions, but the biggest value of this is it makes macros in (for
example) type position easier to implement, as there's this single thing
to modify.

By my measurements (using `-Z time-passes` on libstd and librustc etc.),
this appears to have little-to-no impact on expansion speed. There are
presumably larger costs than the small number of extra allocations and
virtual calls this adds (notably, all `macro_rules!`-defined macros have
not changed in behaviour, since they had to use the `AnyMacro` trait
anyway).
2014-04-16 17:53:27 +10:00
Alex Crichton
da3625161d Removing imports of std::vec_ng::Vec
It's now in the prelude.
2014-03-20 09:30:14 -07:00
Daniel Micay
14f656d1a7 rename std::vec_ng -> std::vec
Closes #12771
2014-03-20 04:25:32 -04:00
Patrick Walton
198cc3d850 libsyntax: Fix errors arising from the automated ~[T] conversion 2014-03-01 22:40:52 -08:00
Patrick Walton
58fd6ab90d libsyntax: Mechanically change ~[T] to Vec<T> 2014-03-01 22:40:52 -08:00
Patrick Walton
70c5a0fbf7 libsyntax: Introduce an InternedString type to reduce @str in the
compiler and use it for attributes
2014-02-02 01:44:47 +11:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
Patrick Walton
758d854436 libsyntax: De-@mut token in the parser 2014-01-02 14:16:07 -08:00
Patrick Walton
f499d365ad libsyntax: Make the parser mutable 2014-01-02 14:16:07 -08:00
Steven Fackler
8143662836 Start passing around &mut ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
0607c138ca Stop using @ExtCtxt 2013-12-28 21:16:03 -07:00
Marvin Löbel
539f37925c Modernized a few type names in rustc and syntax 2013-09-01 14:43:26 +02:00
Erick Tryzelaar
68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Huon Wilson
e995d9935b syntax: implement cfg!() which evaluates to true/false where #[cfg] would keep/remove.
Example:

   if cfg!(test) {
      calculation_to_run_only_when_testing();
   }
2013-08-01 23:03:03 +10:00