Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions examples/start/main.asa
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#import Builtin.Memory;
#import Builtin.Strings;

#import Builtin.PipeOperatorTest;

//#import GameLogic;

//#file "./function_redefine.asa";
Expand All @@ -25,27 +27,26 @@ Or individual components:
create::string() #inline; #replaceable; {
return *(#new string);
}
create :: string(c : *char) #inline; {
s : string = string();
create :: string(c : *char) {
s : string = *(#new string);
puts("Creating new string from *char\n");

s.tS.x = 5;

len : uint32 = 15;
len : uint32 = 10;
//for(i : 0..4_294_967_296){
// //if(c[i] == '\0')
// // break;
// len++;
//}
s.address = malloc(len);
s.address = malloc(10*2);
s.length = 10;
//len = 5;
//s.address = malloc(5);
for(i : 0..len){
s.address[i] = 'A';
//s.address[i] = c[i];
}
s.length = len;
s.address = "String value example";
//s.length = len;
//s.address = "String value example";
puts("Done!\n");
return s;
}
Expand Down Expand Up @@ -96,20 +97,24 @@ newline::() #inline; #hideast {

main :: (){
//printf("Hello World!");
x = 70+2;
//x = 70+2;
//y : uint16 = 4;
f = float(1);
//f = float(1);

var : bool;
//var : bool;

s : string = string();
s = string("This works");

pipeTest(1);

//s.length = 8;
//printint(s.length);
//s.size();
puts("printing string...");
puts(s.address);
//s.length = 5;
printint(s.length);
newline();
s.print();
puts("Done!");

Expand All @@ -124,23 +129,23 @@ main :: (){
//puts("main function works!\n");

//putchar(x);
x = x+1;
//x = x+1;
//putchar(*x_ptr);
//putchar(32);

arr : *int = malloc(8*4);
//arr : *int = malloc(8*4);

arr[2] = 72;
//arr[2] = 72;

//puts("Hello World!");

////modifyReference(x);
//printint(x);

//newline();
putchar(arr[2]);
//putchar(arr[2]);

newline();
//newline();

//if(1 || 0){
// putchar(72);
Expand Down
2 changes: 1 addition & 1 deletion modules/Builtin/asa.asa
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ PipeOperatorTest :: module{
return y*5;
}
pipeTest::int(z : int){
//return fnX(z) -> fnY(%);
return fnX(z) -> fnY(%);
}
}
Loading