summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-40/+40
2013-07-31auto merge of #8162 : thestinger/rust/no-copy, r=brsonbors-8/+8
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-8/+8
2013-07-31auto merge of #8150 : dotdash/rust/assert_bloat, r=huonwbors-1/+1
Assertions without a message get a generated message that consists of a prefix plus the stringified expression that is being asserted. That prefix is currently a unique string, while a static string would be sufficient and needs less code.
2013-07-31Reduce code bloat from assert!()Björn Steinbrink-1/+1
Assertions without a message get a generated message that consists of a prefix plus the stringified expression that is being asserted. That prefix is currently a unique string, while a static string would be sufficient and needs less code.
2013-07-30syntax: implement foreach .. in .. { .. } via desugaring.Graydon Hoare-1/+155
2013-07-30Added str::char_offset_iter() and str::rev_char_offset_iter()Marvin Löbel-1/+1
Renamed bytes_iter to byte_iter to match other iterators Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs Reordered the Iterator section Whitespace fixup Moved clunky `each_split_within` function to the one place in the tree where it's actually needed Replaced all block doccomments in str with line doccomments
2013-07-30auto merge of #8107 : michaelwoerister/rust/end_of_spanned, r=cmrbors-9/+9
Contiunation of naming cleanup in `libsyntax::ast`: ```rust ast::node_id => ast::NodeId ast::local_crate => ast::LOCAL_CRATE ast::crate_node_id => ast::CRATE_NODE_ID ast::blk_check_mode => ast::BlockCheckMode ast::ty_field => ast::TypeField ast::ty_method => ast::TypeMethod ``` Also moved span field directly into `TypeField` struct and cleaned up overlooked `ast::CrateConfig` renamings from last pull request. Cheers, Michael
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-9/+9
blk_check_mode, ty_field, ty_method}
2013-07-29Added %p directive to fmt!, which expects *T as argumentDo Nhat Minh-0/+2
2013-07-24Disallow non-comma-delimited arguments to fmt! and bytes!Birunthan Mohanathas-6/+7
Closes #4982.
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-7/+5
2013-07-22De-spanned<T> and renamed ast::field (now ast::Field)Michael Woerister-7/+7
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-42/+42
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-20auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwaltonbors-73/+72
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-73/+72
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-18librustc: Forbid `&` pointers (other than `&'static`) inside `@` boxes.Patrick Walton-2/+1
This makes custom borrowing implementations for custom smart pointers sound.
2013-07-17libsyntax: Remove some multi-gigabyte clones that were preventing ↵Patrick Walton-6/+6
bootstrapping on Windows.
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-3/+3
2013-07-17librustc: Remove `copy` expressions from the language.Patrick Walton-4/+0
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-81/+104
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-33/+30
2013-07-17Made ast::blk not use spanned<T> anymore.Michael Woerister-16/+15
2013-07-17Clean-up tests after debug!/std-macros change.Huon Wilson-1/+2
The entire testsuite is converted to using info! rather than debug! because some depend on the code within the debug! being trans'd.
2013-07-16syntax: make a macros-injection pass; conditionally define debug! to a noop ↵Huon Wilson-42/+59
based on cfg(debug). Macros can be conditionally defined because stripping occurs before macro expansion, but, the built-in macros were only added as part of the actual expansion process and so couldn't be stripped to have definitions conditional on cfg flags. debug! is defined conditionally in terms of the debug config, expanding to nothing unless the --cfg debug flag is passed (to be precise it expands to `if false { normal_debug!(...) }` so that they are still type checked, and to avoid unused variable lints).
2013-07-14Make TLS keys actually take up spaceAlex Crichton-2/+6
If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer
2013-07-14Purge the last remnants of the old TLS apiAlex Crichton-6/+6
Closes #3273
2013-07-14Clean up various warnings throughout the codebaseAlex Crichton-1/+2
2013-07-13Rename print!()/println!() to printf!()/printfln!()Kevin Ballard-8/+14
The new names make it obvious that these generate formatted output. Add a one-argument case that uses %? to format, just like the other format-using macros (e.g. info!()).
2013-07-13Add print! and println! macros. Closes #7653.Birunthan Mohanathas-0/+12
2013-07-12auto merge of #7736 : thestinger/rust/doc, r=thestingerbors-16/+7
2b96408 r=sanxiyn documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-16/+7
2013-07-10Change the assert_eq message to be more verbose.Corey Richardson-1/+2
Closes #6221
2013-07-08Correct merge errorsNiko Matsakis-5/+5
2013-07-08syntax: Patch up code that was using irrefutable patterns incorrectlyNiko Matsakis-12/+20
2013-07-07remove some method resolve workaroundsDaniel Micay-1/+1
2013-07-07De-share ast::TyJames Miller-78/+77
2013-07-07De-manage OptVec<TyParamBounds>James Miller-33/+27
2013-07-07De-share trait_refJames Miller-5/+5
Also, makes the pretty-printer use & instead of @ as much as possible, which will help with later changes, though in the interim has produced some... interesting constructs.
2013-07-07De-manage LifetimeJames Miller-10/+9
2013-07-07De-managed ast::PathJames Miller-49/+49
2013-07-07Stop allocating view_items with @James Miller-11/+11
2013-07-05Do not rely on newtype enum dereferenceSeo Sanghyeon-26/+23
2013-07-04Implement consuming iterators for ~[], remove vec::{consume, ↵Huon Wilson-2/+1
consume_reverse, map_consume}.
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-0/+2
2013-06-30Remove vec::{map, mapi, zip_map} and the methods, except for .map, since thisHuon Wilson-23/+20
is very common, and the replacement (.iter().transform().collect()) is very ugly.
2013-06-29Remove mutability from unique boxes in the ASTAlex Crichton-1/+1
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-5/+11
for making them noncopyable.
2013-06-28librustc: Fix merge fallout.Patrick Walton-1/+1
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-30/+30
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.