Commit Graph

564 Commits

Author SHA1 Message Date
Erick Tryzelaar
3953bdd812 Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-02-28 07:25:31 -08:00
bors
d0a12347de auto merge of #5141 : nikomatsakis/rust/region-syntax-expl-lifetimes, r=nikomatsakis
Major changes are:
- replace ~[ty_param] with Generics structure, which includes
  both OptVec<TyParam> and OptVec<Lifetime>;
- the use of syntax::opt_vec to avoid allocation for empty lists;

cc #4846

r? @graydon
2013-02-27 17:36:41 -08:00
Niko Matsakis
c623d21e38 Introduce lifetime declarations into the lists of type parameters.
Major changes are:
- replace ~[ty_param] with Generics structure, which includes
  both OptVec<TyParam> and OptVec<Lifetime>;
- the use of syntax::opt_vec to avoid allocation for empty lists;

cc #4846
2013-02-27 19:42:09 -05:00
Erick Tryzelaar
7d0ec86c4a Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-02-27 11:03:21 -08:00
Patrick Walton
07c3f5c0de librustc: Forbid pub or priv before trait implementations 2013-02-27 09:40:16 -08:00
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
Erick Tryzelaar
ea36a0dee1 libsyntax: add some more explicit copies 2013-02-26 20:48:12 -08:00
Erick Tryzelaar
4ae91e2961 libsyntax: add explicit copies 2013-02-26 20:48:11 -08:00
Erick Tryzelaar
8d239a256d libsyntax: change closures to take fn(&Parser) 2013-02-26 20:48:06 -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
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
Patrick Walton
24893e8d02 libsyntax: Stop parsing ~mut 2013-02-26 04:18:12 -08:00
Erick Tryzelaar
375c298297 libsyntax: change binop_to_str to be pure 2013-02-26 03:22:14 -08:00
Erick Tryzelaar
de6d9f66b5 libsyntax: change token_is_word to take &Token 2013-02-26 02:58:39 -08:00
Erick Tryzelaar
34c02a6c0e libsyntax: change Parser::unexpected_last to take &Token 2013-02-26 02:36:21 -08:00
Erick Tryzelaar
28691a0852 libsyntax: more minor cleanup 2013-02-26 02:14:01 -08:00
Erick Tryzelaar
ff36986fa4 libsyntax: change token fns to take &Token 2013-02-26 01:51:41 -08:00
Erick Tryzelaar
d346b51997 libsyntax: change token::to_str to take &Token 2013-02-26 01:29:27 -08:00
Erick Tryzelaar
194f29c20f libsyntax: minor cleanup 2013-02-26 01:07:09 -08:00
Erick Tryzelaar
380597eba3 libsyntax: change parse_matcher_subseq to take &Token 2013-02-26 00:44:49 -08:00
Erick Tryzelaar
cf6e21a17f libsyntax: change attr::parse_seq_* to take &Token 2013-02-26 00:22:30 -08:00
Erick Tryzelaar
3180d22dde libsyntax: change parse_trait_ref_list to take a &Token 2013-02-26 00:00:04 -08:00
Erick Tryzelaar
bff22cf166 libsyntax: add some explicit copies 2013-02-25 23:37:45 -08:00
Erick Tryzelaar
752befe2a6 libsyntax: change token_is_{word,keyword} to take &Token 2013-02-25 23:15:22 -08:00
Erick Tryzelaar
272c25e938 libsyntax: minor cleanup 2013-02-25 22:52:57 -08:00
Erick Tryzelaar
3635480b15 libsyntax: change expect to take &token::Token 2013-02-25 22:30:32 -08:00
Erick Tryzelaar
f3965829ff libsyntax: change flip_delimiter to take a &token::Token 2013-02-25 22:08:09 -08:00
Erick Tryzelaar
4650da5888 libsyntax: change eat to take a &token 2013-02-25 21:45:46 -08:00
Erick Tryzelaar
1deb858b22 libsyntax: is_keyword should take a &~str 2013-02-25 21:23:21 -08:00
Erick Tryzelaar
8b94ef0302 libsyntax: fix the span in parse_bottom_expr's INTERPOLATED handler 2013-02-25 21:00:53 -08:00
Ben Striegel
abc4ea2001 Stop parsing capture clauses 2013-02-25 19:49:28 -05:00
Erick Tryzelaar
d20438695e libsyntax: make lexer vecs_implicitly_copyable-free 2013-02-25 08:12:01 -08:00
Erick Tryzelaar
5b9e110eab libsyntax: Convert ast::attribute_ to store a @meta_item 2013-02-25 06:19:44 -08:00
Patrick Walton
934c938f90 libsyntax: De-mut the parser. rs=demuting 2013-02-22 16:09:16 -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
John Clements
27b06777e6 Cleanup, commenting, trivial renaming 2013-02-21 16:17:06 -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
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
Luqman Aden
b02f5c2090 Get rid of structural records in libsyntax and the last bit in librustc. 2013-02-21 00:19:15 -08:00
Patrick Walton
bf2a225c0b librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -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
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
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
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
Luqman Aden
0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00