summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
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>)`.
2016-10-31Changed most vec! invocations to use square bracesiirelu-31/+31
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-13/+1
2016-10-14Avoid many CrateConfig clones.Nicholas Nethercote-5/+9
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-07-19Introduced `NoDelim` and modified the compiler to support it.cgswords-3/+4
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-5/+11
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-13/+11
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-3/+3
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-11/+5
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-9/+12
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-23Refactor away duplicate method `ecx.block_all()`Jeffrey Seyfried-3/+3
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-13/+11
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-2/+3
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-9/+12
Modified tests to point to the new file now.
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-3/+3
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-11/+5
reference)
2016-05-31simplify HR subtyping back to what we did beforeNiko Matsakis-1/+1
A lot of the refactors, however, seem helpful, so leave those in, particularly since we may want to make this change in the future.
2016-04-24syntax: Check paths in visibilities for type parametersVadim Petrochenkov-5/+6
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-19/+6