about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
AgeCommit message (Collapse)AuthorLines
2016-09-24Refactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an ↵Jeffrey Seyfried-39/+32
`ExtCtxt`.
2016-09-23reviewer comments and rebasingNick Cameron-7/+4
2016-09-15Remove `MacroRulesTT`.Jeffrey Seyfried-3/+36
2016-09-13Move macro resolution into `librustc_resolve`.Jeffrey Seyfried-2/+2
2016-09-05Refactor `SyntaxEnv`.Jeffrey Seyfried-2/+2
2016-09-05In `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`Jeffrey Seyfried-2/+1
with a single field `directory: PathBuf`.
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-2/+2
2016-08-07Make metavariables hygienic.Jeffrey Seyfried-12/+12
2016-07-23macros: Improve `tt` fragmentsJeffrey Seyfried-3/+13
2016-07-13Start a best-effort warning cycle.Jeffrey Seyfried-1/+1
2016-07-13cleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.Jeffrey Seyfried-7/+1
2016-07-12Parse macro-expanded statements like ordinary statements.Jeffrey Seyfried-1/+7
2016-07-06Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrcbors-6/+7
Fix expansion performance regression **syntax-[breaking-change] cc #31645** This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424. By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`. r? @nrc
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-6/+7
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-6/+3
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-24/+21
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-18/+21
syntax-[breaking-change] cc #31645 (Only breaking because ast::TokenTree is now tokenstream::TokenTree.) This pull request refactors TokenTrees into their own file as src/libsyntax/tokenstream.rs, moving them out of src/libsyntax/ast.rs, in order to prepare for an accompanying TokenStream implementation (per RFC 1566).
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-8/+8
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-8/+8
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-18/+21
Modified tests to point to the new file now.
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-23/+21
reference)
2016-06-13Add support for macro expansion inside trait itemsJoseph Dunne-0/+15
2016-06-07Auto merge of #33982 - LeoTestard:remove-check-matcher-old, r=pnkfelixbors-233/+18
Remove the old FOLLOW checking (aka `check_matcher_old`). It was supposed to be removed at the next release cycle but is still in the tree since like 6 months. Potential breaking change, since some cases (such as #25658) will change from a warning to an error. But the warning stating that it will be a hard error in the next release has been there for 6 months now. I think it's safe to break this code. ^_^
2016-06-06Remove the old FOLLOW checking (aka `check_matcher_old`).Leo Testard-233/+18
2016-05-26Reject a LHS formed of a single sequence TT during `macro_rules!` checking.Leo Testard-9/+4
This was already rejected during expansion. Encountering malformed LHS or RHS during expansion is now considered a bug.
2016-05-24Avoid iterating two times over the list of LHSes.Leo Testard-5/+4
2016-05-24Make sure that macros that didn't pass LHS checking are not expanded.Leo Testard-41/+56
This avoids duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros. Fixes #29231.
2016-04-27Make some fatal lexer errors recoverablemitaa-1/+3
2016-04-24syntax: Check paths in visibilities for type parametersVadim Petrochenkov-2/+2
syntax: Merge PathParsingMode::NoTypesAllowed and PathParsingMode::ImportPrefix syntax: Rename PathParsingMode and its variants to better express their purpose syntax: Remove obsolete error message about 'self lifetime syntax: Remove ALLOW_MODULE_PATHS workaround syntax/resolve: Adjust some error messages resolve: Compare unhygienic (not renamed) names with keywords::Invalid, invalid identifiers may appear to be valid after renaming
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-3/+3
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-24/+22
2016-04-13implement RFC amendment 1494Alex Burka-0/+1
2016-03-22try! -> ?Jorge Aparicio-2/+2
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-02Fix the search paths for macro-expanded non-inline modulesJeffrey Seyfried-1/+7
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-11/+11
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-3/+3
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-5/+5
2016-01-27trpl: fix macro follow setsAlex Burka-0/+1
2016-01-23add `[` to FOLLOW(ty) and FOLLOW(path)Alex Burka-1/+1
Following RFC 1462 (amending 550). Closes #31135.
2016-01-07extending FOLLOW(NT) as specified in amendment.Felix S. Klock II-4/+7
See RFC amendment 1384: https://github.com/rust-lang/rfcs/pull/1384
2016-01-07macro_rules: proper FIRST/FOLLOW computations for checking macro_rules validity.Felix S. Klock II-16/+500
See RFC amendment 1384 and tracking issue 30450: https://github.com/rust-lang/rfcs/pull/1384 https://github.com/rust-lang/rust/issues/30450 Moved old check_matcher code into check_matcher_old combined the two checks to enable a warning cycle (where we will continue to error if the two checks agree to reject, accept if the new check says accept, and warn if the old check accepts but the new check rejects).
2016-01-06Auto merge of #30654 - nrc:panictry, r=brsonbors-4/+4
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery. [breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2016-01-04Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-2/+2
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-4/+4
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30use structured errorsNick Cameron-15/+28
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-4/+4
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-17Remove unused importsJeffrey Seyfried-2/+2
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-4/+4
Also split out emitters into their own module.
2015-12-15Generated code spans now point to callsite parameters (where applicable)Daniel Campbell-5/+8
2015-11-25Fix "Cannot fill in a NT" ICEJonas Schievink-12/+23