about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Rename `TokenStream::concat` and remove `TokenStream::concat_rc_vec`.Nicholas Nethercote-1/+1
`TokenStream::new` is a better name for the former, and the latter is now just equivalent to `TokenStream::Stream`.
2018-12-10Remove `tokenstream::Delimited`.Nicholas Nethercote-17/+15
Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-4/+4
2018-12-02Remove not used `DotEq` tokenyui-knk-1/+0
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-11-08Rollup merge of #55777 - nnethercote:less-P-in-ast, r=petrochenkovMark Rousskov-2/+2
Use `Lit` rather than `P<Lit>` in `ast::ExprKind`. Because it results in fewer allocations and small speedups on some benchmarks.
2018-11-08Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.Nicholas Nethercote-2/+2
Because it results in fewer allocations and small speedups on some benchmarks.
2018-10-28Provide specific label for patern parsing errorEsteban Küber-1/+1
2018-09-08Track distinct spans for open and close delimiterDavid Tolnay-9/+13
2018-08-19mv (mod) codemap source_mapDonato Sciarra-3/+3
2018-08-19mv FileMap SourceFileDonato Sciarra-1/+1
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-3/+4
2018-07-10Deny bare trait objects in in src/libsyntaxljedrz-12/+12
2018-05-15Represent lifetimes as two joint tokens in proc macrosVadim Petrochenkov-0/+1
2018-04-12Change the hashcounts in raw `Lit` variants from usize to u16.Nicholas Nethercote-1/+1
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-06Remove more duplicated spansVadim Petrochenkov-1/+1
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-1/+1
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-1/+1
2018-03-22Clean up raw identifier handling when recovering tokens from AST.Lymia Aluysia-2/+3
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-5/+6
2018-03-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-1/+1
syntax: Make imports in AST closer to the source and cleanup their parsing This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-1/+1
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-1/+0
2018-02-18Replace dummy spans with empty spansSeiichi Uchida-2/+2
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-1/+7
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-2/+2
2017-12-28Fix build and add a macro lifetime labels testMatt Peterson-2/+1
2017-12-28Resurrecting #33135Michael Hewson-0/+7
Started rebasing @sgrif's PR #33135 off of current master. (Well, actually merging it into a new branch based off current master.) The following files still need to be fixed or at least reviewed: - `src/libsyntax/ext/tt/macro_parser.rs`: calls `Parser::parse_lifetime`, which doesn't exist anymore - `src/libsyntax/parse/parser.rs`: @sgrif added an error message to `Parser::parse_lifetime`. Code has since been refactored, so I just took it out for now. - `src/libsyntax/ext/tt/transcribe.rs`: This code has been refactored bigtime. Not sure whether @sgrif's changes here are still necessary. Took it out for this commit.
2017-12-26Do not panic on interpolated token inside quote macroSeiichi Uchida-1/+5
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-6/+5
2017-09-22Add support for `..=` syntaxAlex Burka-0/+2
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-06-26Add `LazyTokenStream`.Jeffrey Seyfried-18/+18
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-2/+2
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-05-17Auto merge of #41961 - kennytm:fix-35829, r=petrochenkovbors-36/+20
Fix #35829 (`quote!()` does not handle `br#"…"#`) Fix issue #35829 (syntax extension's `quote_expr!()` does not handle `b"…"` and proc_macro's `quote!()` does not handle `r#"…"#`) * Handles `b"…"`, `br#"…"#` and `...` for `quote_expr!()`. * Refactored the match statement to allow it to complain loudly on any unhandled token. * Similarly, proc_macro's `quote!()` did not handle `br#"…"#` or `r#"…"#`, so this PR fixes it too.
2017-05-13Fix #35829 (syntax extension's `quote_expr!()` does not handle b"…")kennytm-36/+20
* Handles `b"…"`, `br#"…"#` and `...` for `quote_expr!()`. * Refactored the match statement to allow it to complain loudly on any unhandled token. * Similarly, proc_macro's `quote!()` did not handle `br#"…"#` or `r#"…"#`, so this commit fixes it too.
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-2/+2
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-03-21Refactor parsing of trait object typesVadim Petrochenkov-1/+1
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-3/+11
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-18/+21
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-105/+45
`tokenstream::TokenTree::Sequence`.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-1/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-01-23Remove `open_span` and `close_span` from `Delimited`.Jeffrey Seyfried-7/+3
2017-01-17syntax: Rename parse_ty -> parse_ty_no_plus, parse_ty_sum -> parse_tyVadim Petrochenkov-1/+1
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-2/+4
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-5/+4
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-5/+6
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-2/+2
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-2/+2
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-22/+32
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.