Grammer loading works and test file can lex itself. Got rid of regex memory saftey for speed, will reintroduce next

This commit is contained in:
Nathan Braswell
2015-07-06 13:48:19 -04:00
parent 501331e37b
commit 92f5c63c9a
7 changed files with 61 additions and 10 deletions

View File

@@ -127,6 +127,10 @@ obj vector<T> (Object) {
return i;
return -1;
}
// ditto
fun contains<U>(item: U): bool {
return find(item) != -1
}
fun operator[]=(index: int, dataIn: T) {
set(index, dataIn)
@@ -140,6 +144,11 @@ obj vector<T> (Object) {
for (var i = 0; i < dataIn.size; i++;)
addEnd(dataIn[i]);
}
// same darn trick
fun add_unique<U>(dataIn: U): void {
if (!contains(dataIn))
addEnd(dataIn)
}
fun add(dataIn: T): void { addEnd(dataIn); }
fun addEnd(dataIn: T): void {
if (size+1 >= available)