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

@@ -2,14 +2,16 @@ import io:*
import mem:*
import vector:*
obj pair<T, U> {
// pair2 because we actually have a pair now
obj pair2<T, U> {
var first: T
var second: U
}
fun id<T>(in: T): T { return in; }
fun idVec<T>(in: vector<T>): T { return in.get(0); }
fun pairFun<T>(in: pair<T, int>, another:double): T {
fun pairFun<T>(in: pair2<T, int>, another:double): T {
println(in.second)
println(another)
return in.first;
@@ -21,7 +23,7 @@ fun main():int {
aVec.addEnd(12)
println(fromTemplateFun)
println(idVec(aVec))
var testPair: pair<char*, int>
var testPair: pair2<char*, int>
testPair.first = "test string"
testPair.second = 9
var someFloat = 13.88