about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
AgeCommit message (Collapse)AuthorLines
2018-05-27innacurate -> inaccurateTakanori Ishibashi-1/+1
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-6/+6
2018-05-20Auto merge of #50855 - nnethercote:fewer-macro_parser-allocs, r=petrochenkovbors-24/+73
Speed up the macro parser These three commits reduce the number of allocations done by the macro parser, in some cases dramatically. For example, for a clean check builds of html5ever, the number of allocations is reduced by 40%. Here are the rustc-benchmarks that are sped up by at least 1%. ``` html5ever-check avg: -6.6% min: -10.3% max: -4.1% html5ever avg: -5.2% min: -9.5% max: -2.8% html5ever-opt avg: -4.3% min: -9.3% max: -1.6% crates.io-check avg: -1.8% min: -2.9% max: -0.6% crates.io-opt avg: -1.0% min: -2.2% max: -0.1% crates.io avg: -1.1% min: -2.2% max: -0.2% ```
2018-05-18Make `Directory::path` a `Cow`.Nicholas Nethercote-1/+2
Because we create a lot of these in the macro parser, but only very rarely modify them. This speeds up some html5ever runs by 2--3%.
2018-05-18Introduce `MatcherPosHandle`.Nicholas Nethercote-11/+59
This lets us store most `MatcherPos` instances on the stack. This speeds up various runs of html5ever, the best by 3%.
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-3/+6
2018-05-17Change `TokenTreeOrTokenTreeVec` to `TokenTreeOrTokenTreeSlice`.Nicholas Nethercote-19/+19
This avoids a `to_owned` call that can be hot, speeding up the various runs of html5ever by 1--5%, and some runs of crates.io by 2--3%.
2018-05-13stabilize :lifetimeAlex Burka-13/+1
2018-05-13Macros: Add a 'literal' fragment specifierDan Aloni-2/+21
Implements RFC 1576. See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md Changes are mostly in libsyntax, docs, and tests. Feature gate is enabled for 1.27.0. Many thanks to Vadim Petrochenkov for following through code reviews and suggestions. Example: ````rust macro_rules! test_literal { ($l:literal) => { println!("literal: {}", $l); }; ($e:expr) => { println!("expr: {}", $e); }; } fn main() { let a = 1; test_literal!(a); test_literal!(2); test_literal!(-3); } ``` Output: ``` expr: 1 literal: 2 literal: -3 ```
2018-05-03check if the token is a lifetime before parsingrleungx-1/+7
2018-04-16Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkovbors-67/+22
Update `?` repetition disambiguation. **Do not merge** (yet) This is a test implementation of some ideas from discussion in https://github.com/rust-lang/rust/issues/48075 . This PR - disallows `?` repetition from taking a separator, since the separator is never used. - disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach? cc @durka @alexreg @nikomatsakis
2018-04-06Make lifetime nonterminals closer to identifier nonterminalsVadim Petrochenkov-2/+2
2018-04-06Remove more duplicated spansVadim Petrochenkov-2/+2
2018-04-06Use `Span::apply_mark` where possibleVadim Petrochenkov-3/+3
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-3/+3
2018-04-06Use `Span` instead of `SyntaxContext` in `Ident`Vadim Petrochenkov-8/+5
2018-04-05No separator for `?`. No `?` as a separator.Mark Mansi-67/+22
2018-03-22Clean up raw identifier handling when recovering tokens from AST.Lymia Aluysia-1/+1
2018-03-18Return a is_raw parameter from Token::ident rather than having separate methods.Lymia Aluysia-4/+4
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-14/+15
2018-03-17Reject `_` in `ident` matcherVadim Petrochenkov-17/+19
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-2/+1
2018-03-16Auto merge of #48524 - abonander:check-macro-stability, r=petrochenkovbors-1/+12
check stability of macro invocations I haven't implemented tests yet but this should be a pretty solid prototype. I think as-implemented it will also stability-check macro invocations in the same crate, dunno if we want that or not. I don't know if we want this to go through `rustc::middle::stability` or not, considering the information there wouldn't be available at the time of macro expansion (even for external crates, right?). r? @nrc closes #34079 cc @petrochenkov @durka @jseyfried #38356
2018-03-07check stability of macro invocationsAustin Bonander-1/+12
2018-03-05Turn features() into a query.Michael Woerister-17/+15
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-11/+13
2018-01-30Update a few commentsMark Mansi-1/+4
2018-01-30Fix trailing whitespaceMark Mansi-1/+1
2018-01-30Improved tests + typo fixes + assertMark Mansi-0/+2
2018-01-30Add feature gate + testsMark Mansi-10/+68
2018-01-30Fix typo in error message + update testsMark Mansi-1/+1
2018-01-30Attempted fix for `?` kleene opMark Mansi-23/+21
2018-01-30Run rustfmt on macro_parser.rsMark Mansi-4/+6
2018-01-30Run rustfmt on quoted.rsMark Mansi-10/+21
2018-01-30Update the macro parser to allow at most once repetitions for `?` KleeneMark Mansi-16/+22
2018-01-30Allow `?` as a KleeneOp in the macro parserMark Mansi-46/+84
2018-01-30Rollup merge of #47732 - mark-i-m:markim_comments_0001, r=jseyfriedkennytm-126/+351
Run rustfmt and add doc comments to libsyntax/ext/tt/macro_parser.rs Similar to #47603 cc @theotherphil since you reviewed my other PR :smile: And because they are already assigned on #47603: r? @arielb1
2018-01-30Rollup merge of #47603 - mark-i-m:markim_comments_0000, r=jseyfriedkennytm-39/+173
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains _no changes_ to the code itself -- just formatting and comments. I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...
2018-01-29fix typosMark Mansi-4/+4
2018-01-29Update commentMark Mansi-1/+2
2018-01-26A few more commentsMark Mansi-0/+8
2018-01-26Still more commentsMark Mansi-2/+26
2018-01-26Added/improved commentsMark Mansi-17/+61
2018-01-26Added lots of comments + minor reorganizationMark Mansi-34/+94
2018-01-26Added a bunch of comments to macro_parser.rsMark Mansi-10/+62
2018-01-26Run rustfmt on /libsyntax/ext/tt/macro_parser.rsMark Mansi-78/+114
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-5/+5
errors
2018-01-21Fix typosMark Mansi-3/+3
2018-01-19Add a bunch of doc commentsMark Mansi-3/+72
2018-01-19Run rustfmt and add commentsMark Mansi-38/+103