@@ -65,11 +65,6 @@ pub impl @json.FromJson for Cirru with from_json(json, path) {
6565 }
6666}
6767
68- ///|
69- impl Default for Cirru with default () -> Cirru {
70- List (Array ::new ())
71- }
72-
7368///|
7469pub impl Show for Cirru with output (self : Cirru , logger : & Logger ) -> Unit {
7570 match self {
@@ -98,7 +93,7 @@ pub impl Compare for Cirru with compare(self, other) -> Int {
9893 match (self , other ) {
9994 (Leaf (a ), Leaf (b )) => a .compare (b )
10095 (List (xs ), List (ys )) => {
101- let size = @math .minimum (xs .length (), ys .length ())
96+ let size = @cmp .minimum (xs .length (), ys .length ())
10297 for i = 0 ; i < size ; i = i + 1 {
10398 let x = xs [i ]
10499 let y = ys [i ]
@@ -149,7 +144,7 @@ pub fn Cirru::is_nested(self : Cirru) -> Bool {
149144///|
150145pub fn Cirru ::is_comment (self : Cirru ) -> Bool {
151146 match self {
152- Leaf (s ) => s .char_at ( 0 ) == ';'
147+ Leaf (s ) => s .length () > 0 && s [ 0 ] == ';'
153148 _ => false
154149 }
155150}
@@ -167,7 +162,7 @@ priv enum CirruLexState {
167162 Indent
168163 /// Working on a string
169164 Str
170- } derive ( Show )
165+ }
171166
172167///|
173168/// lexer is a simpler state machine to tokenize Cirru code
@@ -201,7 +196,7 @@ fn CirruLexItem::is_normal_str(tok : String) -> Bool {
201196 }
202197 let mut i = 0
203198 while i < size {
204- let c = tok . char_at ( i )
199+ let c = tok [ i ]
205200 match c {
206201 'A' ..= 'Z' => ()
207202 'a' ..= 'z' => ()
@@ -239,7 +234,7 @@ fn escape_cirru_leaf(s : String) -> String {
239234 let size = s .length ()
240235 let mut i = 0
241236 while i < size {
242- let c = s . char_at ( i )
237+ let c = s [ i ]
243238 match c {
244239 '\n ' => out + = "\\ n"
245240 '\t ' => out + = "\\ t"
0 commit comments