about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_parser.rs
AgeCommit message (Collapse)AuthorLines
2017-04-15Implementation of the `vis` macro matcher.Daniel Keep-0/+1
2017-03-30Improve `Path` spans.Jeffrey Seyfried-1/+1
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-5/+4
2017-03-21Refactor parsing of trait object typesVadim Petrochenkov-1/+1
2017-03-14Cleanup.Jeffrey Seyfried-1/+1
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-21/+11
2017-02-28Add warning cycle.Jeffrey Seyfried-9/+23
2017-02-28Remove `Token::MatchNt`.Jeffrey Seyfried-8/+6
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-20/+24
`tokenstream::TokenTree::Sequence`.
2017-01-20Rollup merge of #39118 - jseyfried:token_tree_based_parser, r=nrcAlex Crichton-20/+4
Refactor the parser to consume token trees This is groundwork for efficiently parsing attribute proc macro invocations, bang macro invocations, and `TokenStream`-based attributes and fragment matchers. This improves parsing performance by 8-15% and expansion performance by 0-5% on a sampling of the compiler's crates. r? @nrc
2017-01-17Avoid interpolated token trees.Jeffrey Seyfried-16/+1
2017-01-17Refactor the parser to consume token trees.Jeffrey Seyfried-4/+3
2017-01-17syntax: Rename parse_ty -> parse_ty_no_plus, parse_ty_sum -> parse_tyVadim Petrochenkov-1/+1
2016-12-07macros: fix the expected paths for a non-inline module matched by an `item` ↵Jeffrey Seyfried-3/+4
fragment.
2016-11-12Remove extra level of nesting.Mark-Simulacrum-35/+32
2016-11-12Move next_eis out of main loop to avoid re-allocating and dropping it.Mark-Simulacrum-1/+2
2016-11-12Use SmallVector for eof and bb eis.Mark-Simulacrum-6/+4
2016-11-12Factor out inner current Earley item loop.Mark-Simulacrum-146/+153
Change multiple functions to be non-public. Change nameize to accept an iterator so as to avoid an allocation.
2016-11-12Refactor parse_nt.Mark-Simulacrum-8/+13
2016-11-12Factor out NamedParseResult.Mark-Simulacrum-4/+3
2016-11-12Clean up extraneous &mut.Mark-Simulacrum-1/+1
2016-11-12Refactor to extending from a drain instead of while looping.Mark-Simulacrum-3/+1
2016-11-12Remove unused argument from nameize.Mark-Simulacrum-6/+6
Also makes nameize non-public since it's only locally used.
2016-11-12Cleanup macro_parser::parse, removing a few clones.Mark-Simulacrum-51/+35
2016-11-04Improve `tt`-heavy expansion performance.Jeffrey Seyfried-3/+12
2016-11-03Move doc comment desugaring into the parser.Jeffrey Seyfried-1/+1
2016-11-03Avoid recontructing the `Parser` in `macro_parser.rs`.Jeffrey Seyfried-21/+16
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-7/+6
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-7/+2
2016-10-25Don't use `Rc` in `TokenTreeOrTokenTreeVec`.Nicholas Nethercote-3/+3
This avoids 800,000 allocations when compiling html5ever.
2016-10-25Use `SmallVector` for the stack in `macro_parser::parse`.Nicholas Nethercote-6/+4
This avoids 800,000 heap allocations when compiling html5ever.
2016-10-21Replace the `String` in `ParseResult::Failure` with `Token`.Nicholas Nethercote-6/+13
This lets us delay creation of failure messages until they are needed, which avoids ~1.6M allocations in html5ever.
2016-10-21Avoid an unnecessary clone in `macro_parser::parse`.Nicholas Nethercote-1/+1
This avoids ~800,000 allocations in html5ever.
2016-10-19Rollup merge of #37208 - jseyfried:fix_partially_consumed_tokens_in_macros, ↵Eduard-Mihai Burtescu-12/+9
r=nrc macros: fix partially consumed tokens in macro matchers Fixes #37175. This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from #34630 by ~8%. r? @nrc
2016-10-17Fix partially consumed tokens in macro matchers.Jeffrey Seyfried-12/+9
2016-10-14Avoid many CrateConfig clones.Nicholas Nethercote-1/+1
This commit changes `ExtCtx::cfg()` so it returns a `CrateConfig` reference instead of a clone. As a result, it also changes all of the `cfg()` callsites to explicitly clone... except one, because the commit also changes `macro_parser::parse()` to take `&CrateConfig`. This is good, because that function can be hot, and `CrateConfig` is expensive to clone. This change almost halves the number of heap allocations done by rustc for `html5ever` in rustc-benchmarks suite, which makes compilation 1.20x faster.
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-2/+2
2016-08-07Make metavariables hygienic.Jeffrey Seyfried-5/+5
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-4/+5
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-23Move errors from libsyntax to its own crateJonathan Turner-6/+6
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-4/+5
Modified tests to point to the new file now.
2016-05-24Make sure that macros that didn't pass LHS checking are not expanded.Leo Testard-8/+3
This avoids duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros. Fixes #29231.
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: Get rid of token::IdentStyleVadim Petrochenkov-6/+6
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-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-1/+1
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-1/+1
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-2/+2
[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-11/+21
2015-12-17Remove unused importsJeffrey Seyfried-1/+1