From 44575f708aed13f4260c6ce27b35ab102e5dd9f2 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Sat, 16 Jul 2016 19:11:28 +0000 Subject: [PATCH] Rename `mtwt` to `hygiene` --- src/librustc/session/config.rs | 4 ++-- src/librustc_driver/driver.rs | 12 ++++++------ src/librustc_resolve/assign_ids.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/libsyntax/ast.rs | 2 +- src/libsyntax/ext/expand.rs | 2 +- src/libsyntax/ext/{mtwt.rs => hygiene.rs} | 2 +- src/libsyntax/lib.rs | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) rename src/libsyntax/ext/{mtwt.rs => hygiene.rs} (98%) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index bc271e9ecc8e..65b97abfccbd 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -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 = (None, parse_opt_string, diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 6b141ca15c05..ab3b20e08c80 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -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 { diff --git a/src/librustc_resolve/assign_ids.rs b/src/librustc_resolve/assign_ids.rs index 77facbfb6179..70e566de8a7b 100644 --- a/src/librustc_resolve/assign_ids.rs +++ b/src/librustc_resolve/assign_ids.rs @@ -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; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 36cd2ef6002a..aa8c706ea1e2 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -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}; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 1f716923a16e..a8bb255fba4a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -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; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 767d1ddb8e24..18342f2e38c1 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -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}; diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/hygiene.rs similarity index 98% rename from src/libsyntax/ext/mtwt.rs rename to src/libsyntax/ext/hygiene.rs index c4af4a1f85b9..521930f69a93 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/hygiene.rs @@ -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, diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 8febf1c49ec2..5ad174441889 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -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;