about summary refs log tree commit diff
path: root/src/libsyntax/ext/expand.rs
AgeCommit message (Collapse)AuthorLines
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-32/+22
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2015-01-05Ungate default type parameters.Huon Wilson-2/+0
These are in scope for 1.0, and this is good to e.g. find as many bugs as possible.
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-1/+1
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-2/+2
2015-01-02Make type in ast::Local optionalSeo Sanghyeon-1/+1
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-1/+1
2014-12-31syntax: unbox closures used in function argumentsJorge Aparicio-1/+1
2014-12-30Fallout from stabilizationAaron Turon-1/+1
2014-12-29Slash the ast::Stmt type from 104 to 24 bytes.Huon Wilson-1/+1
(on platforms with 64-bit pointers.) The StmtMac variant is rather large and also fairly rare, so let's optimise the common case.
2014-12-21Fallout of std::str stabilizationAlex Crichton-29/+28
2014-12-21rollup merge of #20059: nick29581/self-implAlex Crichton-4/+47
r? @sfackler closes #20000
2014-12-20Allow `Self` in impls.Nick Cameron-4/+47
2014-12-20Drop the Match prefix from the MatchSource variantsBarosl Lee-4/+8
2014-12-20Print a friendly error for the if-let construct without an else blockBarosl Lee-1/+3
Fixes #19991.
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-31/+32
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-15auto merge of #19778 : aochagavia/rust/ice, r=alexcrichtonbors-9/+10
Fixes #19734
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-18/+0
language. Recommend `move||` instead.
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+7
2014-12-12Fix #19734 (ICE)Adolfo Ochagavía-9/+10
2014-11-24Fixed "::::" appearing in module_path!()Murarth-2/+9
2014-11-19Merge the ExprFnBlock and ExprUnboxedClosure into one ExprClosure with an ↵Niko Matsakis-3/+4
optional unboxed closure kind.
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+1
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-16Complete the removal of ty_nil, ast::LitNil, ast::TyBot and ast::TyUniqJakub Bukaj-1/+1
[breaking-change] This will break any uses of macros that assumed () being a valid literal.
2014-10-29Rename fail! to panic!Steve Klabnik-3/+3
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-19/+19
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-16libsyntax: Remove all uses of {:?}.Luqman Aden-5/+5
2014-10-10Teach libsyntax about `while let`John Gallagher-0/+36
2014-10-01Limit recursion depth for macro expansions, closes #17628Florian Hahn-0/+2
2014-09-30Update after the fall out from the syntax::ptr changesJakub Wieczorek-30/+36
2014-09-30Update based on PR feedbackKevin Ballard-20/+16
2014-09-30Produce a better error for irrefutable `if let` patternsKevin Ballard-1/+1
Modify ast::ExprMatch to include a new value of type ast::MatchSource, making it easy to tell whether the match was written literally or produced via desugaring. This allows us to customize error messages appropriately.
2014-09-30Desugar 'if let' into the appropriate 'match'Kevin Ballard-1/+90
2014-09-26Hide the quote_*! macros when the feature gate is offKeegan McAllister-22/+21
This makes it easier to experiment with improved quasiquoting as an ordinary plugin library. The list of quote macros in feature_gate.rs was already out of sync; this commit also prevents that problem in the future.
2014-09-20auto merge of #17319 : kmcallister/rust/method-macro-bt, r=pcwaltonbors-1/+4
We were leaving these on the stack, causing spurious backtraces.
2014-09-19rollup merge of #17338 : nick29581/variants-namespaceAlex Crichton-3/+3
2014-09-19Add enum variants to the type namespaceNick Cameron-3/+3
Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant.
2014-09-18syntax: use an index in CodeMap instead of Gc for ExpnInfo.Eduard Burtescu-22/+5
2014-09-17Pop the expansion context after expanding a method macroKeegan McAllister-1/+4
We were leaving these on the stack, causing spurious backtraces. I've confirmed that this test fails without the fix.
2014-09-16Fallout from renamingAaron Turon-13/+13
2014-09-14syntax: tests: fix fallout from using ptr::P.Eduard Burtescu-1/+2
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-288/+288
2014-09-13auto merge of #17162 : sfackler/rust/decorator-traits, r=huonwbors-5/+4
The other extension types already worked this way and it can be useful to track some state along with the extension. I also removed the `BasicMacroExpander` and `BasicIdentMacroExpander` since the span inside of them was never used. The expander function types now directly implement the relevant trait.
2014-09-12Track the visited AST's lifetime throughout Visitor.Eduard Burtescu-4/+4
2014-09-12Remove largely unused context from Visitor.Eduard Burtescu-23/+22
2014-09-10Change ItemModifier and ItemDecorator to traitsSteven Fackler-5/+4
For convenience, the traits are implemented for the respective bare functions. Change code from this: ```rust ItemDecorator(some_function) // or ItemModifier(some_other_function) ``` to ```rust ItemDecorator(box some_function) // or ItemModifier(box some_other_function) ``` [breaking-change]
2014-08-29Add support for labeled while loops.Pythoner6-0/+6
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-89/+102
2014-08-13librustc: Parse, but do not fully turn on, the `ref` keyword forPatrick Walton-2/+4
by-reference upvars. This partially implements RFC 38. A snapshot will be needed to turn this on, because stage0 cannot yet parse the keyword. Part of #12381.
2014-07-31auto merge of #15999 : Kimundi/rust/fix_folder, r=nikomatsakisbors-6/+6
Note: This PR is motivated by an attempt to write an custom syntax extension that tried to use `syntax::fold`, and that could only do so by fixing bugs in it and copying out private functions. --- Refactored `syntax::fold` Prior to this, the code there had a few issues: - Default implementations inconsistenly either had the prefix `noop_` or not. - Some default methods where implemented in terms of a public noop function for user code to call, others where implemented directly on the trait and did not allow users of the trait to reuse the code. - Some of the default implementations where private, and thus not reusable for other implementors. - There where some bugs where default implemntations called other default implementations directly, rather than to the underlying Folder, with the result of some ast nodes never being visted even if the user implemented that method. (For example, the current Folder never folded struct fields) This commit solves this situation somewhat radically by making __all__ `fold_...` functions in the module into Folder methods, and implementing them all in terms of public `noop_...` functions for other implementors to call out to. Some public functions had to be renamed to fit the new system, so this is a breaking change. --- Also added a few trait implementations to `ast` types
2014-07-29libsyntax: Don't ICE on macro invocation in count expr of fixed array type.Luqman Aden-2/+5