More work on grammer and standard library! It can kinda load grammer now! Kinda. Marcus ran into the function pointer returns pointer ambiguity, so that'll have to be done tomorrow.

This commit is contained in:
Nathan Braswell
2015-07-04 03:21:36 -04:00
parent b62c3e729f
commit 54721b4284
11 changed files with 149 additions and 4 deletions

4
tests/grammer.kgm Normal file
View File

@@ -0,0 +1,4 @@
# comment
a = b ;
b = "c" ;
b = "c" "d" ;

View File

@@ -1,7 +1,34 @@
import io
import io: something
//comments
fun first(): cutomTye {
}
fun another(): cutomTye<hello, beta>* {
}
fun main():int {
if (true) {
thing;
}
if ( 3 < 300) {
}
if ( 3 > 300) {
}
var hastype: type = 20
thingy.other;
if ( 3 < 300) {
}
io::print("hi")
wanna.callit(internal, to ,it)
var a = 2 + 7;
var b = 2 + 7 / 3 - 2 * 7 && 9 || 2 + !g
return 0
return 11820
return 1.1
return 1.1f
return "hi"
}

11
tests/test_grammer.krak Normal file
View File

@@ -0,0 +1,11 @@
import io:*
import grammer:*
import string:*
fun main():int {
var a = load_grammer(string("grammer.kgm"))
println(a.to_string())
return 0
}

View File

@@ -0,0 +1,6 @@
fun main():int {
var wr: fun():int*
return 0
}

View File

@@ -9,3 +9,5 @@ a
now win!
true
false
2
lines

View File

@@ -22,6 +22,7 @@ fun main(): int {
io::println(newWay)
io::println( string::string("yes") == string::string("yes") )
io::println( string::string("no") == string::string("yes") )
string::string("2\nlines").lines().for_each(fun(i: string::string) io::println(i);)
return 0;
}