Added ability to add commits the Kraken grammer file. Started work on class traits and else statements.

This commit is contained in:
Nathan Braswell
2014-07-06 23:42:25 -07:00
parent 91a68ac2b1
commit 46b9fc8b7f
8 changed files with 57 additions and 14 deletions

View File

@@ -5,7 +5,11 @@ typedef template<T> vector {
T *data;
int size;
int available;
vector<T> *construct() {
bool destroyItems;
vector<T> *construct(bool destroyItemsIn) {
destroyItems = destroyItemsIn;
return construct();
size = 0;
available = 8;
data = new<T>(8);
@@ -13,8 +17,10 @@ typedef template<T> vector {
}
void destruct() {
//Destruction of contained data should depend on if the stored things are objects or primitives.
delete<T>(data, size);
if (destroyItems)
delete<T>(data, size);
else
delete<T>(data);
}
bool resize(int newSize) {