提交 9215d7e5 编写于 作者: J John Clements

comments only

上级 bcdcaea5
......@@ -1070,7 +1070,7 @@ pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
// these following tests are quite fragile, in that they don't test what
// *kind* of failure occurs.
// make sure that macros can leave scope
// make sure that macros can't escape fns
#[should_fail]
#[test] fn macros_cant_escape_fns_test () {
let src = "fn bogus() {macro_rules! z (() => (3+4))}\
......@@ -1088,7 +1088,7 @@ pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
expand_crate(&sess,cfg,vec!(),vec!(),crate_ast);
}
// make sure that macros can leave scope for modules
// make sure that macros can't escape modules
#[should_fail]
#[test] fn macros_cant_escape_mods_test () {
let src = "mod foo {macro_rules! z (() => (3+4))}\
......@@ -1105,7 +1105,7 @@ pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
expand_crate(&sess,cfg,vec!(),vec!(),crate_ast);
}
// macro_escape modules shouldn't cause macros to leave scope
// macro_escape modules should allow macros to escape
#[test] fn macros_can_escape_flattened_mods_test () {
let src = "#[macro_escape] mod foo {macro_rules! z (() => (3+4))}\
fn inty() -> int { z!() }".to_string();
......@@ -1114,7 +1114,6 @@ pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
"<test>".to_string(),
src,
Vec::new(), &sess);
// should fail:
let cfg = ::syntax::ext::expand::ExpansionConfig {
deriving_hash_type_parameter: false,
crate_id: from_str("test").unwrap(),
......@@ -1185,6 +1184,12 @@ fn expand_crate_str(crate_str: String) -> ast::Crate {
// binding should match the second two varrefs, and the second binding
// should match the first varref.
//
// Put differently; this is a sparse representation of a boolean matrix
// indicating which bindings capture which identifiers.
//
// Note also that this matrix is dependent on the implicit ordering of
// the bindings and the varrefs discovered by the name-finder and the path-finder.
//
// The comparisons are done post-mtwt-resolve, so we're comparing renamed
// names; differences in marks don't matter any more.
//
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册