Mercurial > repos > rhope
comparison string.rhope @ 72:f7bcf3db1342
Add =@String, fix bool bug
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 18 Jun 2010 17:00:50 -0400 |
parents | c40c3d399133 |
children | a748300a4143 |
comparison
equal
deleted
inserted
replaced
71:c40c3d399133 | 72:f7bcf3db1342 |
---|---|
151 //TODO: Handle invalid slicepoints | 151 //TODO: Handle invalid slicepoints |
152 left <- String Slice[string, 0i32, slicepoint] | 152 left <- String Slice[string, 0i32, slicepoint] |
153 right <- String Slice[string, slicepoint, [[string]Length >>]-[slicepoint]] | 153 right <- String Slice[string, slicepoint, [[string]Length >>]-[slicepoint]] |
154 } | 154 } |
155 | 155 |
156 Byte@String[string,index:out,invalid] | |
157 { | |
158 out,invalid <- [[string]Buffer >>]Index[index] | |
159 } | |
160 | |
161 Length@String[string:out] | |
162 { | |
163 out <- [string]Length >> | |
164 } | |
165 | |
166 _=String[left,right,index:out] | |
167 { | |
168 [left]Byte[index] | |
169 { | |
170 ,out <- If[[~]=[[right]Byte[index]]] | |
171 { | |
172 out <- _=String[left,right,[index]+[1]] | |
173 } | |
174 }{ | |
175 out <- Yes | |
176 } | |
177 } | |
178 | |
179 =@String[left,right:out] | |
180 { | |
181 ,out <- If[[[left]Length] = [[right]Length]] | |
182 { | |
183 out <- _=String[left,right,0] | |
184 } | |
185 } | |
186 | |
156 Blueprint String Slice | 187 Blueprint String Slice |
157 { | 188 { |
158 Source | 189 Source |
159 Offset(Int32,Naked) | 190 Offset(Int32,Naked) |
160 Length(Int32,Naked) | 191 Length(Int32,Naked) |