about summary refs log tree commit diff
path: root/src/libsyntax/ext/expand.rs
AgeCommit message (Collapse)AuthorLines
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+79
2013-08-16auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichtonbors-0/+11
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-16syntax: add a local_data_key macro that creates a key for access to the TLS.Huon Wilson-0/+11
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that have to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-15Switch to new <V:Visitor> visitor (rather than @Visitor).Felix S. Klock II-37/+37
Alpha-renamed top-level visit_* functions to walk_*. (Motivation: Distinguish visit action and recursive traversal.) Abstract over `&mut self` rather than over `@mut self`. This required some acrobatics, notably the `impl<E> Visitor<E> for @mut Visitor<E>` and corresponding introduction of `@mut Visitor` and some local `let mut` bindings. Remove oldvisit reference. Added default implementations for all of the Visitor trait methods. Note that both `visit_expr_post` and `visit_ty` are no-op's by default, just like they are in `oldvisit::default_visitor`. Refactoring: extract logic to ease swapping visit for oldvisit (hopefully).
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-20/+20
2013-08-10Clean up some unused imports in testsErick Tryzelaar-1/+0
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-1/+3
The new macro is available under the name ifmt! (only an intermediate name)
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-2/+2
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-31/+149
This is preparation for removing `@fn`. This does *not* use default methods yet, because I don't know whether they work. If they do, a forthcoming PR will use them. This also changes the precedence of `as`.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-1/+1
2013-07-31auto merge of #8162 : thestinger/rust/no-copy, r=brsonbors-6/+6
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-6/+6
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-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-6/+6
`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-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-9/+10
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-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-2/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-5/+5
2013-07-17Made ast::blk not use spanned<T> anymore.Michael Woerister-8/+7
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-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-10Change the assert_eq message to be more verbose.Corey Richardson-1/+2
Closes #6221
2013-07-07remove some method resolve workaroundsDaniel Micay-1/+1
2013-07-07De-managed ast::PathJames Miller-5/+5
2013-07-05Do not rely on newtype enum dereferenceSeo Sanghyeon-11/+11
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-0/+2
2013-06-27Remove many shared pointersPhilipp Brüschweiler-2/+2
Mostly just low-haning fruit, i.e. function arguments that were @ even though & would work just as well. Reduces librustc.so size by 200k when compiling without -O, by 100k when compiling with -O.
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+1
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-3/+3
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-48/+47
This almost removes the StringRef wrapper, since all strings are Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts several things to be &'static str (the lint table and the intrinsics table). There are many instances of .to_managed(), unfortunately.
2013-06-12Fix a test-predicated use of the visit.rs api.Felix S. Klock II-1/+1
2013-06-12Fix linebreak and whitespace issues to placate make tidy.Felix S. Klock II-1/+2
2013-06-12Visitor refactoring: Step 1, couple (Env, vt<Env>) together in a tuple.Felix S. Klock II-3/+3
2013-06-11option: remove redundant old_iter implsDaniel Micay-1/+3
2013-06-09remove unused import warningsHuon Wilson-10/+8
2013-06-09std: remove fold[lr] in favour of iteratorsHuon Wilson-1/+2
2013-06-06Clean up a handful of build warnings.Michael Sullivan-1/+1
2013-06-05moved TLS of sctable to ast_util, hid parameter in hygiene callsJohn Clements-44/+28
2013-06-05add hygiene support functionsJohn Clements-4/+54
2013-06-05remove unused get_ident_interner'sJohn Clements-3/+2
2013-06-05remove unused cx'sJohn Clements-2/+2
2013-06-05token_to_ident takes argument by referenceJohn Clements-4/+4
2013-06-05interner just uses uints, not idents with syntax contextJohn Clements-7/+7