Commit Graph

939 Commits

Author SHA1 Message Date
Patrick Walton 573a31dfa7 libsyntax: Forbid mutable vectors. rs=demuting 2013-02-27 09:40:16 -08:00
Patrick Walton 8d7e6ef772 libsyntax: Forbid ~mut and ~const. rs=demuting 2013-02-27 09:40:15 -08:00
bors 99a902c81d auto merge of #5120 : jbclements/rust/macros-have-scope, r=pcwalton
r?

After this patch, macros declared in a module, function, or block can only be used inside of that module, function or block, with the exception of modules declared with the #[macro_escape] attribute; these modules allow macros to escape, and can be used as a limited macro export mechanism.

This pull request also includes miscellaneous comments, lots of new test cases, a few renamings, and a few as-yet-unused data definitions for hygiene.
2013-02-26 20:00:38 -08:00
John Clements 6aefaf22c7 typo-fixing and name-changes 2013-02-26 15:48:00 -08:00
John Clements 08b6057538 Macros now leave scope
Macro scope is now delimited by function, block, and module boundaries,
except for modules that are marked with #[macro_escape], which allows
macros to escape.
2013-02-26 10:36:55 -08:00
John Clements 5e319fb282 Adds (more) test cases for auto_encode. 2013-02-26 10:26:42 -08:00
Patrick Walton 24893e8d02 libsyntax: Stop parsing ~mut 2013-02-26 04:18:12 -08:00
Patrick Walton 9b8ce0d3b5 libsyntax: Remove a mutable field from the tests. rs=demuting 2013-02-26 04:18:11 -08:00
Ben Striegel abc4ea2001 Stop parsing capture clauses 2013-02-25 19:49:28 -05:00
Patrick Walton a07192fadd libsyntax: Remove all mutable fields from libsyntax. rs=demuting 2013-02-22 16:09:16 -08:00
Patrick Walton 934c938f90 libsyntax: De-mut the parser. rs=demuting 2013-02-22 16:09:16 -08:00
Patrick Walton 77dc3ad810 libsyntax: De-mut the macro parser. rs=demuting 2013-02-22 16:09:16 -08:00
Patrick Walton 17dcaee9d1 libsyntax: De-mut the pipe compiler 2013-02-22 16:09:15 -08:00
bors c316189d15 auto merge of #5081 : brson/rust/pipes, r=pcwalton
r?
2013-02-22 11:24:38 -08:00
bors cec1f38c30 auto merge of #5077 : jbclements/rust/increase-monomorphization-depth-limit, r=catamorphism
It appears that using deriving_eq/auto_encode on ASTs bumps up against the "gee this looks like infinite unfolding" limit of 10 in monomorphization. Increasing it to 30 seems to solve this problem for me....

Also, commenting and a few renames.
2013-02-21 19:36:35 -08:00
bors e7924ce18f auto merge of #5076 : pcwalton/rust/demuting, r=pcwalton 2013-02-21 18:27:32 -08:00
Brian Anderson dab6a85230 core: Extract comm from pipes. #4742 2013-02-21 17:36:54 -08:00
bors f5cc0b9830 auto merge of #5075 : luqmana/rust/derec, r=catamorphism
Now only `lib core/pipes.rs` has `#[allow(structural_records)]`. That can be removed after a snapshot.
2013-02-21 17:30:32 -08:00
bors ab784b7de5 auto merge of #5059 : Kimundi/rust/incoming, r=catamorphism
compiles-as-is, but needs a snapshot to remove the `stage0`ed extfmt export in core.

Closes #4750
2013-02-21 16:42:35 -08:00
John Clements 27b06777e6 Cleanup, commenting, trivial renaming 2013-02-21 16:17:06 -08:00
Patrick Walton 553c27c515 librustc: De-mut some of trans 2013-02-21 15:45:55 -08:00
Luqman Aden 9ea6a49696 Remove the last bits of structural records from tests/rustc/rusti/rustpkg. 2013-02-21 15:19:40 -08:00
bors e0767bf24f auto merge of #5068 : sethpink/rust/derive-eq-tuple-struct, r=catamorphism
Previously an unimplemented error was thrown when using #[deriving_eq] on tuple-like struct definitions.
2013-02-21 12:30:34 -08:00
bors 4a5e8c5218 auto merge of #5071 : luqmana/rust/derec, r=pcwalton
Rid libsyntax of records and get rid of the last piece in `librustc/front/test.rs`.
2013-02-21 09:20:43 -08:00
Patrick Walton c0defda499 librustc: Separate the rest of the trait bounds with + and stop parsing space-separated ones. rs=plussing 2013-02-21 08:29:48 -08:00
Marvin Löbel 3792eb2a38 Moved core::extfmt to core::private::extfmt
Needs a snapshot to remove stage0 extfmt export in core
2013-02-21 13:32:20 +01:00
Luqman Aden b02f5c2090 Get rid of structural records in libsyntax and the last bit in librustc. 2013-02-21 00:19:15 -08:00
Seth Pink 6f9eb6aa3c Implement #[deriving_eq] on tuple like structs 2013-02-21 15:32:20 +10:00
Patrick Walton bf2a225c0b librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
Luqman Aden cd82c4566b librustc: Get rid of structural records save for front/test.rs. 2013-02-20 18:45:50 -08:00
bors 1f956fc3b2 auto merge of #4999 : erickt/rust/incoming, r=brson
This patch series is doing a couple things with the ultimate goal of removing `#[allow(vecs_implicitly_copyable)]`, although I'm not quite there yet. The main change is passing around `@~str`s in most places, and using `ref`s in others. As far as I could tell, there are no performance changes with these patches, and all the tests pass on my mac.
2013-02-19 12:24:30 -08:00
Erick Tryzelaar e95f21f7be convert SyntaxExtensions's key to a @~str 2013-02-19 10:02:52 -08:00
Erick Tryzelaar de5fdaf934 convert ast::meta_items to take @~strs 2013-02-19 10:02:52 -08:00
Erick Tryzelaar a2b754788d convert syntax::attr to use @~strs 2013-02-19 10:02:51 -08:00
Erick Tryzelaar 1808d747f6 Alias HashMap<~str, SyntaxExtension> to SyntaxExtensions 2013-02-19 10:02:51 -08:00
Erick Tryzelaar 27e235b64a libsyntax and librustc: minor cleanup 2013-02-19 10:02:51 -08:00
Erick Tryzelaar 1a5b8e4aba libsyntax: change attr:get_attr_name to take a ref 2013-02-19 10:02:51 -08:00
Erick Tryzelaar bc62bd3782 libsyntax: make enum variants take refs 2013-02-19 10:02:51 -08:00
Erick Tryzelaar 59ba4fc104 syntax: fix the indentation of a function 2013-02-19 10:02:51 -08:00
Erick Tryzelaar e6d84268fa Change functions from taking ~str to taking &str 2013-02-19 10:02:51 -08:00
Erick Tryzelaar 9da641bd8c libsyntax: convert interner into a modern struct 2013-02-19 10:02:50 -08:00
bors f68335113b auto merge of #5002 : catamorphism/rust/one-tuples, r=graydon
r? @graydon - This is for greater uniformity (for example, macros that generate
tuples). rustc already supported 1-tuple patterns, but there was no
way to construct a 1-tuple term.

@graydon , as far as your comment on #4898 - it did turn out to be solvable inside the macro (since @luqmana already fixed it using structs instead), but I still think it's a good idea to allow 1-tuples, for uniformity. I don't think anyone is likely to trip over it, and I'm not too worried that it changes the amount of ambiguity.
2013-02-19 09:14:33 -08:00
bors 6351515d98 auto merge of #5005 : alexcrichton/rust/bitv++, r=catamorphism
These commits take the old bitv implementation and modernize it with an explicit self, some minor touchups, and using what I think is some more recent patterns (like `::new` instead of `Type()`).

Additionally, this adds an implementation of `container::Set` on top of a bit vector to have as a set of `uint`s. I initially tried to parameterize the type for the set to be `T: NumCast` but I was hitting build problems in stage0 which I think means that it's not in a snapshot yet, so it's just hardcoded as a set of `uint`s now. In the future perhaps it could be parameterized. I'm not sure if it would really add anything, though, so maybe it's nicer to be hardcoded anyway.

I also added some extra methods to do normal bit vector operations on the set in-place, but these aren't a part of the `Set` trait right now. I haven't benchmarked any of these operations just yet, but I imagine that there's quite a lot of room for optimization here and there.
2013-02-18 18:40:33 -08:00
bors 9ba2e65fd6 auto merge of #5004 : luqmana/rust/rename-use-import, r=catamorphism
Seems like my previous pull request got lost along the way somehow. So here it is updated.
2013-02-18 17:48:34 -08:00
Tim Chevalier aa284de1fc rustc: For one-tuples, make parsing and printing the type work
and add a test to reflect-visit-data
2013-02-18 17:45:56 -08:00
Alex Crichton 91fae27912 Modernize bitv mut fields and explicit self 2013-02-17 23:09:20 -05:00
Luqman Aden 0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00
Tim Chevalier 612553cb39 syntax: Allow 1-tuple expressions
This is for greater uniformity (for example, macros that generate
tuples). rustc already supported 1-tuple patterns, but there was no
way to construct a 1-tuple term.
2013-02-17 15:52:05 -08:00
Luqman Aden baeac2f9ac libsyntax: Long lines. 2013-02-17 05:25:26 -05:00
Luqman Aden de57bacf43 libsyntax: Explicit-self-ify pipes compiler. 2013-02-17 05:25:26 -05:00