syntax: use doc comments in the interner
This commit is contained in:
parent
46d1af28b5
commit
181e5f3fc8
|
@ -126,14 +126,14 @@ impl RcStr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A StrInterner differs from Interner<String> in that it accepts
|
/// A StrInterner differs from Interner<String> in that it accepts
|
||||||
// &str rather than RcStr, resulting in less allocation.
|
/// &str rather than RcStr, resulting in less allocation.
|
||||||
pub struct StrInterner {
|
pub struct StrInterner {
|
||||||
map: RefCell<HashMap<RcStr, Name>>,
|
map: RefCell<HashMap<RcStr, Name>>,
|
||||||
vect: RefCell<Vec<RcStr> >,
|
vect: RefCell<Vec<RcStr> >,
|
||||||
}
|
}
|
||||||
|
|
||||||
// when traits can extend traits, we should extend index<Name,T> to get []
|
/// When traits can extend traits, we should extend index<Name,T> to get []
|
||||||
impl StrInterner {
|
impl StrInterner {
|
||||||
pub fn new() -> StrInterner {
|
pub fn new() -> StrInterner {
|
||||||
StrInterner {
|
StrInterner {
|
||||||
|
@ -177,8 +177,8 @@ impl StrInterner {
|
||||||
// lightweight way to get what I want, though not
|
// lightweight way to get what I want, though not
|
||||||
// necessarily the cleanest.
|
// necessarily the cleanest.
|
||||||
|
|
||||||
// create a gensym with the same name as an existing
|
/// Create a gensym with the same name as an existing
|
||||||
// entry.
|
/// entry.
|
||||||
pub fn gensym_copy(&self, idx : Name) -> Name {
|
pub fn gensym_copy(&self, idx : Name) -> Name {
|
||||||
let new_idx = self.len() as Name;
|
let new_idx = self.len() as Name;
|
||||||
// leave out of map to avoid colliding
|
// leave out of map to avoid colliding
|
||||||
|
|
Loading…
Reference in New Issue