Add an option to the parser to avoid parsing out of line modules

This is useful if parsing from stdin or a String and don't want to try and read in a module from another file. Instead we just leave a stub in the AST.
This commit is contained in:
Nick Cameron
2017-05-18 10:37:24 +12:00
parent 7b5c3d2b20
commit a2566301e1
6 changed files with 46 additions and 10 deletions

View File

@@ -109,7 +109,7 @@ impl TokenTree {
path: cx.current_expansion.module.directory.clone(),
ownership: cx.current_expansion.directory_ownership,
};
macro_parser::parse(cx.parse_sess(), tts, mtch, Some(directory))
macro_parser::parse(cx.parse_sess(), tts, mtch, Some(directory), true)
}
/// Check if this TokenTree is equal to the other, regardless of span information.