about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_rules.rs
AgeCommit message (Collapse)AuthorLines
2015-01-21rollup merge of #21429: GuillaumeGomez/macro-fixAlex Crichton-53/+54
This is little clean code of this PR: #21366. I patched the same thing as aochagavia but too slowly obviously. This is a merge of our two codes, more "rust-like".
2015-01-19Updates of the fixGuillaumeGomez-43/+43
2015-01-18Fix #21356Adolfo OchagavĂ­a-14/+15
2015-01-18syntax: allow bare sequences in lhs for follow checkingCorey Richardson-10/+13
Closes #21350
2015-01-07use slicing sugarJorge Aparicio-6/+6
2015-01-06Test fixes and rebase conflictsAlex Crichton-14/+19
2015-01-06rollup merge of #20563: cmr/macro-input-future-proofingAlex Crichton-8/+185
2015-01-06Minor fallout/update FOLLOW setsCorey Richardson-2/+2
2015-01-06rollup merge of #19430: pczarn/interp_tt-cleanupAlex Crichton-9/+10
Conflicts: src/libsyntax/parse/parser.rs
2015-01-07Cleanup and followup to PR #17830: parsing changesPiotr Czarnecki-9/+10
Prevents breaking down `$name` tokens into separate `$` and `name`. Reports unknown macro variables. Fixes #18775 Fixes #18839 Fixes #15640
2015-01-06Stricter rules surrounding adjacent nonterminals and sequencesCorey Richardson-29/+74
2015-01-07Replace full slice notation with index callsNick Cameron-6/+6
2015-01-06syntax: implement 'macro input future proofing'Corey Richardson-8/+140
See RFC 550 (https://github.com/rust-lang/rfcs/pull/550) for the motivation and details. If this breaks your code, add one of the listed tokens after the relevant non-terminal in your matcher. [breaking-change]
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-2/+2
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05Reformat metadata for exported macrosKeegan McAllister-19/+10
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-0/+8
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-16/+5
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2014-12-21Fallout of std::str stabilizationAlex Crichton-6/+6
2014-11-07Add `ast::SequenceRepetition`Piotr Czarnecki-11/+15
2014-11-05Workaround to have doc comments desugared only in macrosPiotr Czarnecki-5/+6
2014-11-05Remove `Matcher`sPiotr Czarnecki-3/+7
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-19/+26
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-4/+1
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-29Rename fail! to panic!Steve Klabnik-1/+1
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-28Use PascalCase for token variantsBrendan Zabarauskas-8/+9
2014-10-26Add a KleeneOp enum for clarityBrendan Zabarauskas-2/+3
2014-10-26Reduce the size of the TokenTreeBrendan Zabarauskas-1/+4
2014-10-26Use standard capitalisation for TokenTree variantsBrendan Zabarauskas-2/+2
2014-10-26Rename TokenTree variants for clarityBrendan Zabarauskas-2/+2
This should be clearer, and fits in better with the `TTNonterminal` variant. Renames: - `TTTok` -> `TTToken` - `TTDelim` -> `TTDelimited` - `TTSeq` -> `TTSequence`
2014-10-26Add Span and separate open/close delims to TTDelimBrendan Zabarauskas-15/+5
This came up when working [on the gl-rs generator extension](https://github.com/bjz/gl-rs/blob/990383de801bd2e233159d5be07c9b5622827620/src/gl_generator/lib.rs#L135-L146). The new definition of `TTDelim` adds an associated `Span` that covers the whole token tree and enforces the invariant that a delimited sequence of token trees must have an opening and closing delimiter. A `get_span` method has also been added to `TokenTree` type to make it easier to implement better error messages for syntax extensions.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-2/+2
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-09-17librustc: Implement associated types behind a feature gate.Patrick Walton-1/+4
The implementation essentially desugars during type collection and AST type conversion time into the parameter scheme we have now. Only fully qualified names--e.g. `<T as Foo>::Bar`--are supported.
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-15/+15
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-20/+19
2014-07-13add make_method method to MacResult traitJohn Clements-1/+18
this allows macro results to be parsed as methods
2014-07-11rename one of the two confusing MacroExpandersJohn Clements-2/+2
There were two things named MacroExpander, which was confusing. I renamed one of them TTMacroExpander. [breaking change]
2014-07-09syntax: doc comments all the thingsCorey Richardson-4/+4
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-3/+3
[breaking-change]
2014-06-13syntax: parse outer attributes in `quote_item!` calls.Huon Wilson-2/+1
Fixes #14857.
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-2/+4
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-4/+5
2014-06-06Change to_str().to_string() to just to_str()Adolfo OchagavĂ­a-1/+1
2014-05-30libsyntax: Fix snake_case errors.Kevin Butler-1/+1
A number of functions/methods have been moved or renamed to align better with rust standard conventions. syntax::ext::mtwt::xorPush => xor_push syntax::parse::parser::Parser => Parser::new [breaking-change]
2014-05-28Add patterns to MacResultKeegan McAllister-0/+5
2014-05-27std: Rename strbuf operations to stringRicho Healey-2/+2
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-1/+1
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-4/+4
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-5/+5
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-4/+4
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1