about summary refs log tree commit diff
path: root/src/libsyntax/ext/base.rs
AgeCommit message (Collapse)AuthorLines
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-45/+29
2017-03-10Move `resolve_invoc` from `syntax` to `resolve`.Jeffrey Seyfried-3/+9
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-4/+2
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-14/+6
2017-03-02Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakisbors-4/+10
suggest doubling recursion limit in more situations Fixes #38852. r? @bluss
2017-03-02note -> helpAlex Burka-1/+1
2017-02-23Move MacroKind into Def::MacroJosh Driver-1/+1
2017-02-16Refactor macro resolution errors + add derive macro suggestionsJosh Driver-10/+34
2017-02-12Allow using inert attributes from `proc_macro_derive`s with ↵Jeffrey Seyfried-9/+6
`#![feature(proc_macro)]`.
2017-02-09suggest doubling recursion limit in more situationsAlex Burka-4/+10
2017-02-05Move derive macro expansion into the MacroExpanderJosh Driver-0/+10
This removes the expand_derives function, and sprinkles the functionality throughout the Invocation Collector, Expander and Resolver.
2017-02-05Rename CustomDerive to ProcMacroDerive for macros 1.1Josh Driver-1/+5
2017-02-05Make builtin derives a SyntaxExtensionJosh Driver-1/+7
This allows builtin derives to be registered and resolved, just like other derive types.
2017-01-17Refactor the parser to consume token trees.Jeffrey Seyfried-3/+1
2016-12-23Allow legacy custom derive authors to disable warnings in downstream crates.Jeffrey Seyfried-0/+2
2016-12-18Avoid including attributes in bang macro invocations.Jeffrey Seyfried-4/+2
2016-12-18Remove scope placeholders, remove method `add_macro` of `ext::base::Resolver`.Jeffrey Seyfried-2/+0
2016-12-18Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,Jeffrey Seyfried-2/+2
remove `export` argument of `resolver.add_macro()`.
2016-11-22Clean up directory ownership semantics.Jeffrey Seyfried-5/+3
2016-11-21Cleanup `InternedString`.Jeffrey Seyfried-1/+1
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-4/+4
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-3/+3
2016-11-17Resolve imports during expansion.Jeffrey Seyfried-0/+2
2016-11-11Change implementation of syntax::util::SmallVector to use ↵Mark-Simulacrum-3/+3
data_structures::SmallVec.
2016-11-10Elimite `$crate` before invokng custom derives.Jeffrey Seyfried-0/+2
2016-11-04Improve `tt`-heavy expansion performance.Jeffrey Seyfried-1/+3
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-5/+3
2016-10-24Refactor away fields `MacroDef::{use_locally, export}`.Jeffrey Seyfried-2/+2
2016-10-19Rollup merge of #37198 - jseyfried:future_proof_macros_11, r=nrcEduard-Mihai Burtescu-5/+5
macros 1.1: future proofing and cleanup This PR - uses the macro namespace for custom derives (instead of a dedicated custom derive namespace), - relaxes the shadowing rules for `#[macro_use]`-imported custom derives to match the shadowing rules for ordinary `#[macro_use]`-imported macros, and - treats custom derive `extern crate`s like empty modules so that we can eventually allow, for example, `extern crate serde_derive; use serde_derive::Serialize;` backwards compatibly. r? @alexcrichton
2016-10-15Use the macro namespace for custom derives.Jeffrey Seyfried-2/+2
2016-10-15Refactor `syntax::ext::base::Resolver::resolve_invoc`.Jeffrey Seyfried-3/+3
2016-10-14Avoid many CrateConfig clones.Nicholas Nethercote-2/+2
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-10-11Add support for undetermined macro invocations.Jeffrey Seyfried-3/+11
2016-10-07Refactor away `ext::expand::{expand_crate, expand_crate_with_expander}`.Jeffrey Seyfried-12/+0
2016-10-07Add macros from plugins in `libsyntax_ext::register_builtins`.Jeffrey Seyfried-6/+1
2016-10-07Combine `std_inject::{no_core, no_std}` into `std_inject::injected_crate_name`.Jeffrey Seyfried-7/+1
2016-10-02Refactor `ext::base::Resolver::add_ext` to only define macros in the crate root.Jeffrey Seyfried-3/+3
2016-09-28Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomatsakisJonathan Turner-2/+4
Allow more non-inline modules in blocks Currently, non-inline modules without a `#[path]` attribute are not allowed in blocks. This PR allows non-inline modules that have an ancestor module with a `#[path]` attribute, provided there is not a nearer ancestor block. For example, ```rust fn main() { #[path = "..."] mod foo { mod bar; //< allowed by this PR fn f() { mod bar; //< still an error } } } ``` Fixes #36772. r? @nikomatsakis
2016-09-28Allow non-inline modules in more places.Jeffrey Seyfried-2/+4
2016-09-27Auto merge of #36601 - jseyfried:build_reduced_graph_in_expansion, r=nrcbors-0/+4
Assign def ids and build the module graph during expansion r? @nrc
2016-09-27With `--test`, make `#[test]` functions `pub` in `InvocationCollector`Jeffrey Seyfried-0/+2
and expand the `__test_reexports` in the correct scope.
2016-09-27Avoid aborting after expansion from `BuildReducedGraphVisitor` errors.Jeffrey Seyfried-0/+2
2016-09-26Remove `TokResult`.Jeffrey Seyfried-142/+1
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-46/+8
2016-09-24Refactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an ↵Jeffrey Seyfried-1/+1
`ExtCtxt`.
2016-09-22Auto merge of #36573 - jseyfried:groundwork, r=nrcbors-2/+4
resolve: groundwork for building the module graph during expansion r? @nrc
2016-09-22Use `Resolver::visit_expansion` only with monotonic expansions.Jeffrey Seyfried-2/+4
2016-09-23reviewer comments and rebasingNick Cameron-62/+86
2016-09-22Adds a `ProcMacro` form of syntax extensionNick Cameron-8/+195
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too. Supports both attribute-like and function-like macros.
2016-09-15Remove `MacroRulesTT`.Jeffrey Seyfried-3/+0