Add casting as a language feature. Have not removed the function yet as we need an inbetween version for the bootstrap

This commit is contained in:
Nathan Braswell
2016-04-18 22:56:29 -04:00
parent d5b930739f
commit cf46fb13af
7 changed files with 71 additions and 9 deletions

View File

@@ -19,6 +19,7 @@ fun print<T>(toPrint: *T) : void{
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%p", (void*)toPrint);
fflush(0);
"""
}
return;
@@ -28,6 +29,7 @@ fun print(toPrint: *char) : void {
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%s", toPrint);
fflush(0);
"""
}
return;
@@ -37,6 +39,7 @@ fun print(toPrint: char) : void {
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%c", toPrint);
fflush(0);
"""
}
return;
@@ -60,6 +63,7 @@ fun print(toPrint: int): void {
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%d", toPrint);
fflush(0);
"""
}
return;
@@ -69,6 +73,7 @@ fun print(toPrint: float): void {
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%f", toPrint);
fflush(0);
"""
}
return;
@@ -78,6 +83,7 @@ fun print(toPrint: double) : void{
__if_comp__ __C__ {
simple_passthrough(toPrint = toPrint::) """
printf("%f", toPrint);
fflush(0);
"""
}
return;