1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
b0VIM 7.4 ��U����� erickt Erick-Tryzelaar-MBP.local ~erickt/projects/rust/rust-syntex/syntex_syntax/src/attr.rs utf-8
3210 #"! U tp + I , v u k � d V ^ � ` - x ad ^ &
+ � { X U � � M ) ( �
�
�
�
�
�
�
<
� � � h . � � � � � m k j E " �
�
�
o
&
� � � � � � � � e H � � � � � � p j i % � � � � g 4 � � � � � � j ; � � � � � } I ) # � � � � ~ Z 3 � � � } w v B ( � � � � n _ I ? 9 8 � fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> { } } _ => None }, } _ => None, ast::LitStr(ref s, _) => Some((*s).clone()), match v.node { MetaNameValue(_, ref v) => { match self.node { fn value_str(&self) -> Option<InternedString> { } } MetaList(ref n, _) => (*n).clone(), MetaNameValue(ref n, _) => (*n).clone(), MetaWord(ref n) => (*n).clone(), match self.node { fn name(&self) -> InternedString { impl AttrMetaMethods for MetaItem { } fn span(&self) -> Span { self.meta().span } } self.node.value.meta_item_list() fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> { } self.meta().value_str() fn value_str(&self) -> Option<InternedString> { fn name(&self) -> InternedString { self.meta().name() } } matches } mark_used(self); if matches { let matches = name == &self.name()[..]; fn check_name(&self, name: &str) -> bool { impl AttrMetaMethods for Attribute { } fn span(&self) -> Span; fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]>; /// Gets a list of inner meta items from a list MetaItem type. fn value_str(&self) -> Option<InternedString>; /// containing a string, otherwise None. /// Gets the string value if self is a MetaNameValue variant fn name(&self) -> InternedString; /// `#[foo="bar"]` and `#[foo(bar)]` /// Retrieve the name of the meta item, e.g. `foo` in `#[foo]`, } name == &self.name()[..] fn check_name(&self, name: &str) -> bool { pub trait AttrMetaMethods { } }) .unwrap_or(false) slot.borrow().get(idx).map(|bits| bits & (1 << shift) != 0) let shift = id % 64; let idx = (id / 64) as usize; USED_ATTRS.with(|slot| { let AttrId(id) = attr.node.id; p println!("after"); println!("aft slot.borrow_mut().extend((0 .. (idx + 1 - len)).map(|_| 0)); let len = slot.borrow().len(); if slot.borrow().len() <= idx { let shift = id % 64; let idx = (id / 64) as usize; USED_ATTRS.with(|slot| { let AttrId(id) = attr.node.id; pub fn mark_used(attr: &Attribute) { } static USED_ATTRS: RefCell<Vec<u64>> = RefCell::new(Vec::new()) thread_local! { use std::fmt; use std::collections::HashSet; use std::cell::{RefCell, Cell}; use ptr::P; use parse::token; use parse::token::{InternedString, intern_and_get_ident}; use parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; use feature_gate::GatedCfg; use diagnostic::SpanHandler; use codemap::BytePos; use codemap::{Span, Spanned, spanned, dummy_spanned}; use ast::{AttrId, Attribute, Attribute_, MetaItem, MetaWord, MetaNameValue, MetaList}; use ast; pub use self::IntType::*; pub use self::ReprAttr::*; pub use self::StabilityLevel::*; // Functions dealing with attributes and meta items // except according to those terms. // option. This file may not be copied, modified, or distributed // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or //