Some more bugfixes, got regex working as well as the cpp version. (leaks memory like craaazy)

This commit is contained in:
Nathan Braswell
2015-06-14 18:13:52 -04:00
parent f60148054f
commit 7b6e47544a
9 changed files with 184 additions and 40 deletions

View File

@@ -42,6 +42,7 @@ obj vector<T> (Object) {
fun destruct(): void {
if (data)
delete(data, size);
//data = 1337
data = 0
}
@@ -84,6 +85,17 @@ obj vector<T> (Object) {
return true;
}
fun slice(start: int, end: int): vector<T> {
var new.construct(): vector<T>
if (start < 0)
start += size + 1
if (end < 0)
end += size + 1
for (var i = start; i < end; i++;)
new.add(data[i])
return new
}
fun at(index: int): T { return get(index); }
fun operator[](index: int): T { return get(index); }
fun get(index: int): T {