convert ast::attribute_ and ast::view_item to a struct

This commit is contained in:
Erick Tryzelaar
2013-01-13 16:51:48 -08:00
parent eafed93d72
commit 4b0f702608
11 changed files with 79 additions and 57 deletions

View File

@@ -91,19 +91,20 @@ fn mk_word_item(name: ~str) -> @ast::meta_item {
}
fn mk_attr(item: @ast::meta_item) -> ast::attribute {
return dummy_spanned({style: ast::attr_inner, value: *item,
is_sugared_doc: false});
dummy_spanned(ast::attribute_ { style: ast::attr_inner,
value: *item,
is_sugared_doc: false })
}
fn mk_sugared_doc_attr(text: ~str,
+lo: BytePos, +hi: BytePos) -> ast::attribute {
let lit = spanned(lo, hi, ast::lit_str(@text));
let attr = {
let attr = ast::attribute_ {
style: doc_comment_style(text),
value: spanned(lo, hi, ast::meta_name_value(~"doc", lit)),
is_sugared_doc: true
};
return spanned(lo, hi, attr);
spanned(lo, hi, attr)
}
/* Conversion */