about summary refs log tree commit diff
path: root/src/libsyntax/ext/expand.rs
AgeCommit message (Collapse)AuthorLines
2013-09-05Remove the __log function for __log_levelAlex Crichton-53/+35
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
2013-09-05Add an ``unreachable!()`` macro.Chris Morgan-0/+30
Rationale: having a function which fails means that the location of failure which is output is that of the unreachable() function, rather than the caller. This is part of #8991 but is not all of it; current usage of ``std::util::unreachable()`` must remain so for the moment, until a new snapshot is made; then I will remove that function entirely in favour of using this macro.
2013-09-04Make non-pub condition! expand to non-pub mod. Fix #6009.Felix S. Klock II-2/+1
2013-09-03auto merge of #8963 : jmgrosen/rust/issue-8881, r=alexcrichtonbors-0/+8
2013-09-03Fixes #8881. condition! imports parent's pub identifiersjmgrosen-0/+8
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-51/+51
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-19/+19
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-20/+20
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-11/+20
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-24Introduce alternate forms of loggingAlex Crichton-23/+30
These new macros are all based on format! instead of fmt! and purely exist for bootstrapping purposes. After the next snapshot, all uses of logging will be migrated to these macros, and then after the next snapshot after that we can drop the `2` suffix on everything
2013-08-24Settle on the format/write/print family of namesAlex Crichton-0/+17
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