Some bugfixes, allow overloading of [] and add that to vector and string, work on regex. Need closures before that finishes....
This commit is contained in:
1
tests/test_regex.expected_results
Normal file
1
tests/test_regex.expected_results
Normal file
@@ -0,0 +1 @@
|
||||
a
|
||||
9
tests/test_regex.krak
Normal file
9
tests/test_regex.krak
Normal file
@@ -0,0 +1,9 @@
|
||||
import io:*
|
||||
import regex:*
|
||||
|
||||
fun main():int {
|
||||
var reg = regex("a")
|
||||
println(reg.regexString)
|
||||
println(reg.long_match("a"))
|
||||
return 0
|
||||
}
|
||||
0
tests/test_regex/test_regex.results
Normal file
0
tests/test_regex/test_regex.results
Normal file
@@ -4,3 +4,5 @@ assignment overload2
|
||||
assignment overload with additional
|
||||
hope
|
||||
hope3
|
||||
new way!
|
||||
a
|
||||
|
||||
@@ -13,6 +13,9 @@ fun main(): int {
|
||||
var initilized:string::string = "hope"
|
||||
io::println(initilized)
|
||||
io::println(initilized+ "3")
|
||||
var newWay = string::string("new way!")
|
||||
io::println(newWay)
|
||||
io::println(newWay[5])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,22 @@ No Traits
|
||||
First Trait
|
||||
Second Trait
|
||||
Both Traits
|
||||
No Traits
|
||||
|
||||
No Traits
|
||||
First Trait
|
||||
Second Trait
|
||||
Both Traits
|
||||
No Traits
|
||||
|
||||
First Trait
|
||||
Second Trait
|
||||
Both Traits
|
||||
No Traits
|
||||
First Trait
|
||||
|
||||
First Trait
|
||||
Second Trait
|
||||
Both Traits
|
||||
No Traits
|
||||
First Trait
|
||||
|
||||
@@ -48,13 +48,22 @@ fun main(): int {
|
||||
var c: Trait2;
|
||||
var d: TwoTrait;
|
||||
var e: AlreadySpecilized;
|
||||
var f: TwoTrait*;
|
||||
|
||||
OneTwoFunc<NoTraits>(a);
|
||||
OneTwoFunc<Trait1>(b);
|
||||
OneTwoFunc<Trait2>(c);
|
||||
OneTwoFunc<TwoTrait>(d);
|
||||
// OneTwoFunc<AlreadySpecilized>(e);
|
||||
OneTwoFunc<TwoTrait*>(f);
|
||||
println();
|
||||
|
||||
OneTwoFunc(a);
|
||||
OneTwoFunc(b);
|
||||
OneTwoFunc(c);
|
||||
OneTwoFunc(d);
|
||||
// OneTwoFunc(e);
|
||||
OneTwoFunc(f);
|
||||
println();
|
||||
|
||||
var alpha: OneTwoObj<NoTraits>;
|
||||
@@ -62,11 +71,20 @@ fun main(): int {
|
||||
var gamma: OneTwoObj<Trait2>;
|
||||
var delta: OneTwoObj<TwoTrait>;
|
||||
// |OneTwoObj<AlreadySpecilized>| epsilon;
|
||||
var zeta: OneTwoObj<TwoTrait*>;
|
||||
|
||||
OneTwoFunc<OneTwoObj<NoTraits>>(alpha);
|
||||
OneTwoFunc<OneTwoObj<Trait1>>(beta);
|
||||
OneTwoFunc<OneTwoObj<Trait2>>(gamma);
|
||||
OneTwoFunc<OneTwoObj<TwoTrait>>(delta);
|
||||
OneTwoFunc<OneTwoObj<TwoTrait*>>(zeta);
|
||||
println()
|
||||
|
||||
OneTwoFunc(alpha);
|
||||
OneTwoFunc(beta);
|
||||
OneTwoFunc(gamma);
|
||||
OneTwoFunc(delta);
|
||||
OneTwoFunc(zeta);
|
||||
|
||||
//We can't pass along our inner part, so let's just make sure that it is the right object.
|
||||
//epsilon.proveSpecilized();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
4
|
||||
1337
|
||||
1337
|
||||
26614
|
||||
9131321
|
||||
15513
|
||||
|
||||
@@ -43,6 +43,9 @@ fun main(): int {
|
||||
for (var i: int = 0; i < intVec.size; i++;)
|
||||
print(intVec.at(i));
|
||||
println();
|
||||
for (var i: int = 0; i < intVec.size; i++;)
|
||||
print(intVec[i]);
|
||||
println();
|
||||
|
||||
// in place lambda map
|
||||
intVec.in_place(fun(it:int):int { return it*2; })
|
||||
|
||||
Reference in New Issue
Block a user