Some bugfixes, allow overloading of [] and add that to vector and string, work on regex. Need closures before that finishes....
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import vector;
|
||||
import mem;
|
||||
|
||||
fun string(in:char*):string {
|
||||
var out:string = in
|
||||
return out
|
||||
}
|
||||
|
||||
obj string (Object) {
|
||||
var data: vector::vector<char>;
|
||||
fun construct(): string* {
|
||||
@@ -33,6 +38,9 @@ obj string (Object) {
|
||||
data.destruct()
|
||||
}
|
||||
|
||||
fun operator[](index: int): char { return data[index]; }
|
||||
fun length():int { return data.size; }
|
||||
|
||||
fun operator=(str: char*): void {
|
||||
destruct();
|
||||
construct(str)
|
||||
|
||||
Reference in New Issue
Block a user