about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_parser.rs
AgeCommit message (Collapse)AuthorLines
2019-09-22rename libsyntax::ext::tt to mbeAleksey Kladov-952/+0
mbe stands for macro-by-example
2019-09-22reduce visibility of a bunch of stuff in ext::ttAleksey Kladov-8/+8
2019-07-25Remove needless indirection through RcMark Rousskov-5/+3
NamedMatch is already cheap to clone due to Lrc's inside.
2019-07-19Remember the span of the Kleene operator in macrosJulien Cretin-3/+3
This is needed for having complete error messages where reporting macro variable errors. Here is what they would look like: error: meta-variable repeats with different kleene operator --> $DIR/issue-61053-different-kleene.rs:3:57 | LL | ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* }; | - expected repetition ^^ - conflicting repetition
2019-07-03Remove needless lifetimesJeremy Stucki-1/+1
2019-06-23let_chains: note re. back-compat wrt. expr beginning.Mazdak Farrokhzad-1/+3
2019-06-23let_chains: readd kw::let to ident_can_begin_expr.Mazdak Farrokhzad-1/+1
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-08syntax: Remove `Deref` impl from `Token`Vadim Petrochenkov-6/+6
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-7/+7
2019-06-08syntax: Keep full `Token`s for `macro_rules` separatorsVadim Petrochenkov-1/+1
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-7/+7
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-21/+18
2019-06-06syntax: Remove duplicate span from `token::Lifetime`Vadim Petrochenkov-2/+2
2019-06-06syntax: Add some helper methods to `Token`Vadim Petrochenkov-7/+6
2019-06-06syntax: Use `Token` in `Parser`Vadim Petrochenkov-9/+8
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-3/+4
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-8/+8
2019-06-06Always use token kinds through `token` module rather than `Token` typeVadim Petrochenkov-20/+20
2019-05-27Use `Symbol` equality in `may_begin_with` and `parse_nt`.Nicholas Nethercote-27/+27
2019-05-24review commentsEsteban Küber-1/+1
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-1/+8
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-4/+4
2019-05-07lots of comments + minor cleanupMark Mansi-1/+4
2019-03-23syntax: Remove warning for unnecessary path disambiguatorsVadim Petrochenkov-1/+1
2019-03-06Panic when unmatched delimiters aren't emittedEsteban Küber-1/+1
2019-02-18Avoid a `clone()` in `transcribe()`.Nicholas Nethercote-9/+10
The current code (expensively) clones the value within an `Rc`. This commit changes things so that the `Rc` itself is (cheaply) cloned instead, avoid some allocations. This requires converting a few `Rc` instances to `Lrc`.
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-5/+5
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-2/+2
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Cleanup importsTaiki Endo-2/+2
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-9/+9
2019-02-07libsyntax => 2018Taiki Endo-15/+16
2019-01-09Change `String` to `&'static str` in `ParseResult::Failure`.Nicholas Nethercote-3/+3
This avoids 770,000 allocations when compiling the `html5ever` benchmark, reducing instruction counts by up to 2%.
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-04Remove redundant cloneShotaro Yamada-1/+1
2018-11-23Reword incorrect macro invocation primary labelEsteban Küber-4/+9
2018-11-23Point at end of macro arm when encountering EOFEsteban Küber-2/+9
Fix #52866
2018-11-13Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiserkennytm-1/+1
Fix typos.
2018-11-12Make `MatcherPos::stack` a `SmallVec`.Niko Matsakis-34/+57
This avoids some allocations.
2018-11-11Fix typos.Bruce Mitchener-1/+1
2018-11-05Auto merge of #55451 - estebank:arg-doc, r=pnkfelixbors-1/+1
Custom diagnostic when trying to doc comment argument When writing ``` pub fn f( /// Comment id: u8, ) {} ``` Produce a targeted diagnostic ``` error: documentation comments cannot be applied to method arguments --> $DIR/fn-arg-doc-comment.rs:2:5 | LL | /// Comment | ^^^^^^^^^^^ doc comments are not allowed here ``` Fix #54801.
2018-11-01Use `SmallVec` for the inner vectors in `MatcherPos::matches`.Nicholas Nethercote-5/+7
This avoids some allocations.
2018-11-01Share empty `Vec`s more within `MatcherPos::matches`.Nicholas Nethercote-4/+9
`create_matches` creates a `Vec<Rc<Vec<NamedMatch>>>`. Even though all the inner `Vec`s are empty, each one is created separately. This commit changes `create_matches` so it instead creates one empty inner `Vec`, and shares it. The commit also changes `MatcherPos::matches` to a boxed slice, because its length doesn't change.
2018-10-28Provide specific label for patern parsing errorEsteban Küber-1/+1
2018-09-26Remove OneVectorljedrz-6/+6
2018-09-08Rename sp_lo to sp_openDavid Tolnay-10/+10
2018-09-08Track distinct spans for open and close delimiterDavid Tolnay-8/+8