Refactor TokenStream to hold Vec<TokenTree> instead of tt::Subtree
`TokenStream` assumes that its subtree's delimeter is `None`, and this should be encoded in the type system instead of having a delimiter field that is mostly ignored. `tt::Subtree` is just `pub delimiter: Option<Delimiter>, pub token_trees: Vec<TokenTree>`, so a Subtree that is statically guaranteed not to have a delimiter is just Vec<TokenTree>.
This commit is contained in:
@@ -52,7 +52,7 @@ pub fn assert_expand(
|
||||
let expander = dylib::Expander::new(&path).unwrap();
|
||||
let fixture = parse_string(ra_fixture).unwrap();
|
||||
|
||||
let res = expander.expand(macro_name, &fixture.subtree, None).unwrap();
|
||||
let res = expander.expand(macro_name, &fixture.into_subtree(), None).unwrap();
|
||||
assert_eq_text!(&expect.trim(), &format!("{:?}", res));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user