summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_parser.rs
AgeCommit message (Collapse)AuthorLines
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
2015-12-15Generated code spans now point to callsite parameters (where applicable)Daniel Campbell-3/+6
2015-11-25Fix "Cannot fill in a NT" ICEJonas Schievink-12/+23
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-17/+17
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-5/+5
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-18/+17
[breaking change]
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-1/+1
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-1/+0
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-5/+5
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-5/+5
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-08-15Slightly improved macro diagnostics + Indentation fixesJonas Schievink-46/+50
2015-08-07improve span of erroneous empty macro invocationTim Neumann-16/+0
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-8/+4
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-6/+6
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-2/+0
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-4/+4
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-15/+15
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-2/+5
passing the latter around.
2015-03-05Auto merge of #22061 - pczarn:quote_matcher_and_attr, r=kmcallisterbors-3/+6
Fixes #19674 Fixes #17396 (already closed, yeah) cc @kmcallister , @cmr
2015-03-04Add quasiquote for matchers and attributesPiotr Czarnecki-3/+6
2015-03-03Switched to Box::new in many places.Felix S. Klock II-1/+1
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.