about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-8315/+0
2019-10-16syntax: reduce visibilitiesMazdak Farrokhzad-1/+1
2019-10-16syntax: extract parse_derive_pathsMazdak Farrokhzad-3/+1
2019-10-15Rollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkovTyler Mandry-2/+1
Remove last uses of gensyms Underscore bindings now use unique `SyntaxContext`s to avoid collisions. This was the last use of gensyms in the compiler, so this PR also removes them. closes #49300 cc #60869 r? @petrochenkov
2019-10-15Remove some mentions of gensymsMatthew Jasper-2/+1
2019-10-15Remove unnecessary `use crate::sess::ParseSess;`.Mazdak Farrokhzad-1/+0
2019-10-15Rollup merge of #65376 - Centril:syntax-extractions-1, r=petrochenkovMazdak Farrokhzad-9/+14
syntax: misc extractions Part of https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-15syntax::parse::sess -> syntax::sessMazdak Farrokhzad-10/+15
2019-10-15Stabilize proc macros generating `macro_rules` itemsVadim Petrochenkov-45/+4
2019-10-14Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkovTyler Mandry-12/+12
Remove `Option` from `TokenStream` A code simplification. r? @petrochenkov
2019-10-14Rollup merge of #65392 - Centril:nt-to-tt, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering Split out from https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-14Rollup merge of #65363 - Centril:less-pprust, r=Mark-SimulacrumMazdak Farrokhzad-7/+15
Remove implicit dependencies on syntax::pprust Part of https://github.com/rust-lang/rust/pull/65324. The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer. r? @estebank
2019-10-14Lazify some `mac_placeholder()` calls.Nicholas Nethercote-7/+7
This avoids some unnecessary creation of empty token streams.
2019-10-14Remove the `Option` in `TokenStream`.Nicholas Nethercote-5/+5
It means an allocation is required to create an empty `TokenStream`, but all other operations are simpler and marginally faster due to not having to check for `None`. Overall it simplifies the code for a negligible performance effect. The commit also removes `TokenStream::empty` by implementing `Default`, which is now possible.
2019-10-13token: extract Nonterminal::to_tokenstream to parser.Mazdak Farrokhzad-1/+1
2019-10-13tokenstream: don't depend on pprustMazdak Farrokhzad-3/+6
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-4/+9
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-13mbe: reduce panictry! uses.Mazdak Farrokhzad-25/+27
2019-10-03proc_macro: Add `Span::mixed_site` exposing `macro_rules` hygieneVadim Petrochenkov-0/+11
2019-10-01Rollup merge of #63931 - petrochenkov:stabmac, r=CentrilMazdak Farrokhzad-17/+6
Stabilize macros in some more positions - Fn-like macros and attribute macros in `extern` blocks - Fn-like procedural macros in type positions - ~Attribute macros on inline modules~ (moved to https://github.com/rust-lang/rust/pull/64273) Stabilization report: https://github.com/rust-lang/rust/pull/63931#issuecomment-526362396. Closes https://github.com/rust-lang/rust/issues/49476 cc https://github.com/rust-lang/rust/issues/54727
2019-09-30syntax: Support modern attribute syntax in the `meta` matcherVadim Petrochenkov-1/+1
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-5/+5
2019-09-30Stabilize proc macros in type positionsVadim Petrochenkov-5/+5
2019-09-30Stabilize macros in `extern` blocksVadim Petrochenkov-12/+1
Add some tests for macros in extern blocks, remove duplicate tests
2019-09-28syntax: don't keep a redundant c_variadic flag in the AST.Eduard-Mihai Burtescu-1/+0
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-2/+2
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-3/+3
2019-09-26Rename `Item.node` to `Item.kind`varkor-14/+14
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-13/+13
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-8/+8
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-3/+3
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-2/+2
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-3/+3
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-9/+9
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-14/+14
For both `ast::Expr` and `hir::Expr`.
2019-09-25remove unused peekableAleksey Kladov-4/+3
2019-09-25move function closer to its usageAleksey Kladov-13/+14
2019-09-25remove unused parametersAleksey Kladov-31/+1
2019-09-24Rollup merge of #64698 - Centril:infer-const-with-stash, r=estebankMazdak Farrokhzad-5/+1
Recover on `const X = 42;` and infer type + Error Stash API Here we: 1. Introduce a notion of the "error stash". This is a map in the `Handler` to which you can `err.stash(...)` away your diagnostics and then steal them in a later "phase" of the compiler (e.g. stash in parser, steal in typeck) to enrich them with more information that isn't available in the previous "phase". I believe I've covered all the bases to make sure these diagnostics are actually emitted eventually even under `#[cfg(FALSE)]` but please check my logic. 2. Recover when parsing `[const | static mut?] $ident = $expr;` which has a missing type. Use the "error stash" to stash away the error and later steal the error in typeck where we emit the error as `MachineApplicable` with the actual inferred type. This builds on https://github.com/rust-lang/rust/pull/62804. cc https://github.com/rust-lang/rfcs/pull/2545 r? @estebank
2019-09-24Rollup merge of #64689 - matklad:refactor-mbe, r=petrochenkovMazdak Farrokhzad-270/+293
Refactor macro by example This doesn't do anything useful yet, and just moves code around and restricts visibility
2019-09-24Stabilize `str::len`, `[T]::len`, `is_empty` and `str::as_bytes` as const fnOliver Scherer-27/+3
2019-09-23cleanup librustc_errors Handler code.Mazdak Farrokhzad-5/+1
2019-09-23Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebankbors-5/+2
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
2019-09-23Rollup merge of #64670 - Mark-Simulacrum:ext-build-simplify, r=petrochenkovMazdak Farrokhzad-316/+9
Cleanup syntax::ext::build I suspect most of this code could be inlined but I only removed the bits where the inlining didn't really hurt readability (i.e., method call -> function call) or the completely unused code.
2019-09-22make mbe::TokenTree private to moduleAleksey Kladov-26/+26
2019-09-22push TokenTree::parse downAleksey Kladov-1/+14
2019-09-22pull mbe token tree definition upAleksey Kladov-232/+241
2019-09-22docstring for mbe moduleAleksey Kladov-0/+5
2019-09-22move mbe module to a separate fileAleksey Kladov-0/+5
2019-09-22rename tt -> mbe, part 2Aleksey Kladov-14/+14