Implement RFC#1559: allow all literals in attributes.
This commit is contained in:
parent
528c6f3ed6
commit
8250a26b5b
45 changed files with 942 additions and 373 deletions
|
@ -277,10 +277,13 @@ pub trait AstBuilder {
|
|||
fn attribute(&self, sp: Span, mi: P<ast::MetaItem>) -> ast::Attribute;
|
||||
|
||||
fn meta_word(&self, sp: Span, w: InternedString) -> P<ast::MetaItem>;
|
||||
|
||||
fn meta_list_item_word(&self, sp: Span, w: InternedString) -> ast::NestedMetaItem;
|
||||
|
||||
fn meta_list(&self,
|
||||
sp: Span,
|
||||
name: InternedString,
|
||||
mis: Vec<P<ast::MetaItem>> )
|
||||
mis: Vec<ast::NestedMetaItem> )
|
||||
-> P<ast::MetaItem>;
|
||||
fn meta_name_value(&self,
|
||||
sp: Span,
|
||||
|
@ -1141,10 +1144,16 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
fn meta_word(&self, sp: Span, w: InternedString) -> P<ast::MetaItem> {
|
||||
attr::mk_spanned_word_item(sp, w)
|
||||
}
|
||||
fn meta_list(&self, sp: Span, name: InternedString, mis: Vec<P<ast::MetaItem>>)
|
||||
|
||||
fn meta_list_item_word(&self, sp: Span, w: InternedString) -> ast::NestedMetaItem {
|
||||
respan(sp, ast::NestedMetaItemKind::MetaItem(attr::mk_spanned_word_item(sp, w)))
|
||||
}
|
||||
|
||||
fn meta_list(&self, sp: Span, name: InternedString, mis: Vec<ast::NestedMetaItem>)
|
||||
-> P<ast::MetaItem> {
|
||||
attr::mk_spanned_list_item(sp, name, mis)
|
||||
}
|
||||
|
||||
fn meta_name_value(&self, sp: Span, name: InternedString, value: ast::LitKind)
|
||||
-> P<ast::MetaItem> {
|
||||
attr::mk_spanned_name_value_item(sp, name, respan(sp, value))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue