Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc

This commit is contained in:
Nathan Braswell
2014-08-01 00:45:48 -07:00
parent 4cf8dbbd5b
commit 5b57770774
31 changed files with 199 additions and 175 deletions

View File

@@ -2,10 +2,10 @@ import io;
import trivial_container;
typedef template <T> TemplateTest {
int a;
T b;
trivialContainer<T> c;
void print() {
|int| a;
|T| b;
|trivialContainer<T>| c;
|void| print() {
print("a: ");
print(a);
print("\n");
@@ -19,17 +19,17 @@ typedef template <T> TemplateTest {
typedef MyInt int;
MyInt c;
|MyInt| c;
template <T> T addAndPrint(T a, T b) {
template <T> |T| addAndPrint(|T| a, |T| b) {
print(a+b);
return a+b;
}
int main() {
TemplateTest<int> test;
TemplateTest<char*> test2;
|int| main() {
|TemplateTest<int>| test;
|TemplateTest<char*>| test2;
test.a = 5;
test.b = 7;
test.c.data = 1337;
@@ -40,7 +40,7 @@ int main() {
test.print();
test2.print();
trivialContainer<char*> testImport;
|trivialContainer<char*>| testImport;
testImport.data = "From another file! Whoh!";
testImport.print();
print("\n");
@@ -49,4 +49,4 @@ int main() {
print("\n");
return 0;
}
}