Rename mtwt to hygiene
This commit is contained in:
parent
76ed445622
commit
44575f708a
8 changed files with 14 additions and 14 deletions
|
|
@ -735,8 +735,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
|||
"for every macro invocation, print its name and arguments"),
|
||||
enable_nonzeroing_move_hints: bool = (false, parse_bool,
|
||||
"force nonzeroing move optimization on"),
|
||||
keep_mtwt_tables: bool = (false, parse_bool,
|
||||
"don't clear the resolution tables after analysis"),
|
||||
keep_hygiene_data: bool = (false, parse_bool,
|
||||
"don't clear the hygiene data after analysis"),
|
||||
keep_ast: bool = (false, parse_bool,
|
||||
"keep the AST after lowering it to HIR"),
|
||||
show_span: Option<String> = (None, parse_opt_string,
|
||||
|
|
|
|||
|
|
@ -236,8 +236,8 @@ pub fn compile_input(sess: &Session,
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn keep_mtwt_tables(sess: &Session) -> bool {
|
||||
sess.opts.debugging_opts.keep_mtwt_tables
|
||||
fn keep_hygiene_data(sess: &Session) -> bool {
|
||||
sess.opts.debugging_opts.keep_hygiene_data
|
||||
}
|
||||
|
||||
fn keep_ast(sess: &Session) -> bool {
|
||||
|
|
@ -479,7 +479,7 @@ pub fn phase_1_parse_input<'a>(sess: &'a Session,
|
|||
input: &Input)
|
||||
-> PResult<'a, ast::Crate> {
|
||||
// These may be left in an incoherent state after a previous compile.
|
||||
syntax::ext::mtwt::reset_hygiene_data();
|
||||
syntax::ext::hygiene::reset_hygiene_data();
|
||||
// `clear_ident_interner` can be used to free memory, but it does not restore the initial state.
|
||||
token::reset_ident_interner();
|
||||
let continue_after_error = sess.opts.continue_parse_after_error;
|
||||
|
|
@ -760,9 +760,9 @@ pub fn phase_2_configure_and_expand<'a, F>(sess: &Session,
|
|||
hir_map::Forest::new(lower_crate(sess, &krate, &mut resolver), &sess.dep_graph)
|
||||
});
|
||||
|
||||
// Discard MTWT tables that aren't required past lowering to HIR.
|
||||
if !keep_mtwt_tables(sess) {
|
||||
syntax::ext::mtwt::reset_hygiene_data();
|
||||
// Discard hygiene data, which isn't required past lowering to HIR.
|
||||
if !keep_hygiene_data(sess) {
|
||||
syntax::ext::hygiene::reset_hygiene_data();
|
||||
}
|
||||
|
||||
Ok(ExpansionResult {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
use Resolver;
|
||||
use rustc::session::Session;
|
||||
use syntax::ast;
|
||||
use syntax::ext::mtwt::Mark;
|
||||
use syntax::ext::hygiene::Mark;
|
||||
use syntax::fold::{self, Folder};
|
||||
use syntax::ptr::P;
|
||||
use syntax::util::move_map::MoveMap;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ use rustc::ty::subst::{ParamSpace, FnSpace, TypeSpace};
|
|||
use rustc::hir::{Freevar, FreevarMap, TraitCandidate, TraitMap, GlobMap};
|
||||
use rustc::util::nodemap::{NodeMap, NodeSet, FnvHashMap, FnvHashSet};
|
||||
|
||||
use syntax::ext::mtwt::Mark;
|
||||
use syntax::ext::hygiene::Mark;
|
||||
use syntax::ast::{self, FloatTy};
|
||||
use syntax::ast::{CRATE_NODE_ID, Name, NodeId, CrateNum, IntTy, UintTy};
|
||||
use syntax::parse::token::{self, keywords};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub use util::ThinVec;
|
|||
use syntax_pos::{mk_sp, Span, DUMMY_SP, ExpnId};
|
||||
use codemap::{respan, Spanned};
|
||||
use abi::Abi;
|
||||
use ext::mtwt::SyntaxContext;
|
||||
use ext::hygiene::SyntaxContext;
|
||||
use parse::token::{self, keywords, InternedString};
|
||||
use print::pprust;
|
||||
use ptr::P;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
use ast::{Block, Crate, Ident, Mac_, Name, PatKind};
|
||||
use ast::{MacStmtStyle, Stmt, StmtKind, ItemKind};
|
||||
use ast;
|
||||
use ext::mtwt::Mark;
|
||||
use ext::hygiene::Mark;
|
||||
use attr::{self, HasAttrs};
|
||||
use attr::AttrMetaMethods;
|
||||
use codemap::{dummy_spanned, ExpnInfo, NameAndSpan, MacroBang, MacroAttribute};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! Machinery for hygienic macros, as described in the MTWT[1] paper.
|
||||
//! Machinery for hygienic macros, inspired by the MTWT[1] paper.
|
||||
//!
|
||||
//! [1] Matthew Flatt, Ryan Culpepper, David Darais, and Robert Bruce Findler.
|
||||
//! 2012. *Macros that work together: Compile-time bindings, partial expansion,
|
||||
|
|
@ -127,7 +127,7 @@ pub mod ext {
|
|||
pub mod base;
|
||||
pub mod build;
|
||||
pub mod expand;
|
||||
pub mod mtwt;
|
||||
pub mod hygiene;
|
||||
pub mod quote;
|
||||
pub mod source_util;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue