diff --git a/lib/rivet/src/ast/Attributes.ri b/lib/rivet/src/ast/Attributes.ri index 9cb27efee..241dff25c 100644 --- a/lib/rivet/src/ast/Attributes.ri +++ b/lib/rivet/src/ast/Attributes.ri @@ -13,20 +13,18 @@ pub struct AttributeDuplicatedError < Throwable { } } -#[boxed] pub struct AttributeArgument { pub name: string; pub expr: Expr; pub is_named: bool; } -#[boxed] pub struct Attribute { pub name: string; pub args: []AttributeArgument; pub pos: token.Pos; - pub func find_argument(self, name: string) -> ?AttributeArgument { + pub func find_argument(&self, name: string) -> ?AttributeArgument { for arg in self.args { if arg.name == name { return arg; @@ -36,7 +34,6 @@ pub struct Attribute { } } -#[boxed] pub struct Attributes { pub mut attributes: []Attribute; @@ -47,7 +44,7 @@ pub struct Attributes { self.attributes.push(attribute); } - pub func find(self, name: string) -> ?Attribute { + pub func find(&self, name: string) -> ?Attribute { for attribute in self.attributes { if attribute.name == name { return attribute; @@ -57,12 +54,12 @@ pub struct Attributes { } #[inline] - pub func has(self, name: string) -> bool { + pub func has(&self, name: string) -> bool { return self.find(name) != none; } #[inline] - pub func is_empty(self) -> bool { + pub func is_empty(&self) -> bool { return self.attributes.is_empty(); } } diff --git a/lib/rivet/src/ast/mod.ri b/lib/rivet/src/ast/mod.ri index a7a3bf34e..5f1f10da0 100644 --- a/lib/rivet/src/ast/mod.ri +++ b/lib/rivet/src/ast/mod.ri @@ -18,7 +18,6 @@ pub enum Node { } } -#[boxed] pub struct Comment { pub mut is_doc: bool; pub mut text: string; diff --git a/lib/rivet/src/utils/maps/mod.ri b/lib/rivet/src/utils/maps/mod.ri index e154667bd..615560675 100644 --- a/lib/rivet/src/utils/maps/mod.ri +++ b/lib/rivet/src/utils/maps/mod.ri @@ -4,13 +4,11 @@ // TODO: remove file, use Map![K, V] instead -#[boxed] struct StringUint { pub key: string; pub mut value: uint; } -#[boxed] pub struct MapStringUint { mut pairs: []mut StringUint; @@ -25,7 +23,7 @@ pub struct MapStringUint { self.pairs.push(StringUint(key, value)); } - pub func get(self, key: string) -> ?uint { + pub func get(&self, key: string) -> ?uint { for pair in self.pairs { if pair.key == key { return pair.value; @@ -44,25 +42,23 @@ pub struct MapStringUint { } #[inline] - pub func contains(self, key: string) -> bool { + pub func contains(&self, key: string) -> bool { return self.get(key) != none; } #[inline] - pub func len(self) -> uint { + pub func len(&self) -> uint { return self.pairs.len; } } - -#[boxed] struct StringArrayOfStrings { pub key: string; pub mut value: []string; } pub struct MapStringArrayOfStringsIterator { - ref: MapStringArrayOfStrings; + ref: &MapStringArrayOfStrings; mut idx: uint; #[inline] @@ -77,11 +73,10 @@ pub struct MapStringArrayOfStringsIterator { } } -#[boxed] pub struct MapStringArrayOfStrings { mut pairs: []mut StringArrayOfStrings; - pub func iterator(self) -> MapStringArrayOfStringsIterator { + pub func iterator(&self) -> MapStringArrayOfStringsIterator { return MapStringArrayOfStringsIterator(self); } @@ -96,7 +91,7 @@ pub struct MapStringArrayOfStrings { self.pairs.push(StringArrayOfStrings(key, value)); } - pub func get(self, key: string) -> ?[]string { + pub func get(&self, key: string) -> ?[]string { for pair in self.pairs { if pair.key == key { return pair.value; @@ -115,23 +110,21 @@ pub struct MapStringArrayOfStrings { } #[inline] - pub func contains(self, key: string) -> bool { + pub func contains(&self, key: string) -> bool { return self.get(key) != none; } #[inline] - pub func len(self) -> uint { + pub func len(&self) -> uint { return self.pairs.len; } } -#[boxed] struct StringBool { pub key: string; pub mut value: bool; } -#[boxed] pub struct MapStringBool { mut pairs: []mut StringBool; @@ -146,7 +139,7 @@ pub struct MapStringBool { self.pairs.push(StringBool(key, value)); } - pub func get(self, key: string) -> ?bool { + pub func get(&self, key: string) -> ?bool { for pair in self.pairs { if pair.key == key { return pair.value; @@ -165,12 +158,12 @@ pub struct MapStringBool { } #[inline] - pub func contains(self, key: string) -> bool { + pub func contains(&self, key: string) -> bool { return self.get(key) != none; } #[inline] - pub func len(self) -> uint { + pub func len(&self) -> uint { return self.pairs.len; } }