Got the new scoping working! Still some odd stuff happening to certian templates, and I think vector is having problems with new/traits. Really need to get canonnical filenames and what not worked out

This commit is contained in:
Nathan Braswell
2014-12-30 01:22:09 -05:00
parent 417e5ed898
commit aaca71a211
35 changed files with 282 additions and 232 deletions

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
typedef Vec2 {
|int| x;

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
|int| fibanacci(|int| num) {
if (num < 2)

View File

@@ -1,5 +1,5 @@
/* Comment first! */
import io;
import io:*;
|int| main() {
println(1337);

View File

@@ -1,5 +1,5 @@
import io;
import mem;
import io:*;
import mem:*;
typedef ClassWithConstructor {
|int| data;

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
typedef DestructorPrint {
|char*| myStr;

View File

@@ -4,6 +4,6 @@ import io;
|int| main() {
nothing();
println("It was nothing");
io::println("It was nothing");
return 0;
}

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
template <T,J> |void| addAndPrint(|T| a, |J| b) {
print(a+b);

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
|int| ret1() {
return ret2() / 2;

View File

@@ -1,13 +1,13 @@
import io;
template <T> |T| addAndPrint(|T| a, |T| b) {
print(a+b);
io::print(a+b);
return a+b;
}
|int| main() {
addAndPrint<int>(10,12);
print("\n");
io::print("\n");
return 0;
}

View File

@@ -1,5 +1,5 @@
import mem;
import io;
import mem:*;
import io:*;
typedef AnObject {
|int| a;

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
typedef firstObject {
|int| objectNum;

View File

@@ -1,5 +1,5 @@
import io;
import trivial_container;
import io:*;
import trivial_container:*;
typedef RegularObject {
|int| num;

View File

@@ -1,12 +1,12 @@
Qualified io!
7
0
9
11
Qualified Container!
Even template functions qualified!
Unqualified io!
8
0
10
12
Unqualified Container!

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
typedef objectA {
|int| a;

View File

@@ -1,7 +1,8 @@
#!/bin/bash
krakenPath="../build/kraken"
testDir=${1:-"../tests"}
#testDir=${1:-"../tests"}
testDir="."
ext=${2:-"krak"}
fileList=""

View File

@@ -3,7 +3,7 @@
typedef unqualified_class {
|int| number;
|qualified_class*| construct(|int| num) {
|unqualified_class*| construct(|int| num) {
number = num;
return this;
}

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
|int| addAndPrintInt(|int| a, |int| b) {
print(a+b);

View File

@@ -5,12 +5,12 @@ typedef template <T,J> TemplateTest {
|T| a;
|J| b;
|void| print() {
print("a: ");
print(a);
print("\n");
print("b: ");
print(b);
print("\n");
io::print("a: ");
io::print(a);
io::print("\n");
io::print("b: ");
io::print(b);
io::print("\n");
}
};

View File

@@ -5,12 +5,12 @@ typedef template <T> TemplateTest {
|int| a;
|T| b;
|void| print() {
print("a: ");
print(a);
print("\n");
print("b: ");
print(b);
print("\n");
io::print("a: ");
io::print(a);
io::print("\n");
io::print("b: ");
io::print(b);
io::print("\n");
}
};

View File

@@ -1,11 +1,10 @@
import io;
typedef FirstObject {
|int| objectNum;
|void| PrintSelf(|int| a) {
print(objectNum);
print(a);
io::print(objectNum);
io::print(a);
}
};
@@ -13,6 +12,6 @@ typedef FirstObject {
|FirstObject| wooObject;
wooObject.objectNum = 5;
wooObject.PrintSelf(7);
print("\n");
io::print("\n");
return 0;
}

View File

@@ -1,5 +1,5 @@
import io;
import trivial_container;
import io:*;
import trivial_container:*;
typedef template <T> TemplateTest {
|int| a;

View File

@@ -1,5 +1,5 @@
import io;
import mem;
import io:*;
import mem:*;
|int| main() {
|int| b;

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1,8 @@
import io;
|int| a = 42;
|int| main() {
io::println(a);
return 0;
}

View File

@@ -1,4 +1,4 @@
import io;
import io:*;
typedef NoTraits {};
@@ -48,13 +48,13 @@ typedef template<T(FirstTrait, SecondTrait)> OneTwoObj {};
|Trait2| c;
|TwoTrait| d;
|AlreadySpecilized| e;
OneTwoFunc<NoTraits>(a);
OneTwoFunc<Trait1>(b);
OneTwoFunc<Trait2>(c);
OneTwoFunc<TwoTrait>(d);
// OneTwoFunc<AlreadySpecilized>(e);
println();
|OneTwoObj<NoTraits>| alpha;

View File

@@ -7,7 +7,7 @@ typedef ClassWithConstructor {
return this;
}
|void| printData() {
println(data);
io::println(data);
}
};
@@ -15,6 +15,6 @@ typedef ClassWithConstructor {
|ClassWithConstructor| object.construct(4);
object.printData();
|int| a = 8;
println(a);
io::println(a);
return 0;
}

View File

@@ -1,6 +1,6 @@
import io;
import mem;
import vector;
import io:*;
import mem:*;
import vector:*;
typedef AbleToBeDestroyed (Destructable) {
|void| destruct() {
@@ -16,9 +16,9 @@ typedef AbleToBeDestroyed (Destructable) {
intVec.addEnd(7);
for (|int| i = 0; i < intVec.size; i++;)
print(intVec.at(i));
println();
|vector<AbleToBeDestroyed>*| desVec = new<vector<AbleToBeDestroyed>>()->construct();
|AbleToBeDestroyed| testDestruct;
desVec->addEnd(testDestruct);