File tree Expand file tree Collapse file tree 10 files changed +520
-175
lines changed Expand file tree Collapse file tree 10 files changed +520
-175
lines changed Original file line number Diff line number Diff line change 55#import Builtin.Memory;
66#import Builtin.Strings;
77
8+ #import Builtin.PipeOperatorTest;
9+
810//#import GameLogic;
911
1012//#file "./function_redefine.asa";
@@ -25,27 +27,26 @@ Or individual components:
2527create::string() #inline; #replaceable; {
2628 return *(#new string);
2729}
28- create :: string(c : *char) #inline; {
29- s : string = string( );
30+ create :: string(c : *char) {
31+ s : string = *(#new string );
3032 puts("Creating new string from *char\n");
3133
32- s.tS.x = 5;
33-
34- len : uint32 = 15;
34+ len : uint32 = 10;
3535 //for(i : 0..4_294_967_296){
3636 // //if(c[i] == '\0')
3737 // // break;
3838 // len++;
3939 //}
40- s.address = malloc(len);
40+ s.address = malloc(10*2);
41+ s.length = 10;
4142 //len = 5;
4243 //s.address = malloc(5);
4344 for(i : 0..len){
4445 s.address[i] = 'A';
4546 //s.address[i] = c[i];
4647 }
47- s.length = len;
48- s.address = "String value example";
48+ // s.length = len;
49+ // s.address = "String value example";
4950 puts("Done!\n");
5051 return s;
5152}
@@ -96,20 +97,24 @@ newline::() #inline; #hideast {
9697
9798main :: (){
9899 //printf("Hello World!");
99- x = 70+2;
100+ // x = 70+2;
100101 //y : uint16 = 4;
101- f = float(1);
102+ // f = float(1);
102103
103- var : bool;
104+ // var : bool;
104105
105106 s : string = string();
106107 s = string("This works");
107108
109+ pipeTest(1);
110+
108111 //s.length = 8;
109112 //printint(s.length);
110113 //s.size();
111114 puts("printing string...");
112- puts(s.address);
115+ //s.length = 5;
116+ printint(s.length);
117+ newline();
113118 s.print();
114119 puts("Done!");
115120
@@ -124,23 +129,23 @@ main :: (){
124129 //puts("main function works!\n");
125130
126131 //putchar(x);
127- x = x+1;
132+ // x = x+1;
128133 //putchar(*x_ptr);
129134 //putchar(32);
130135
131- arr : *int = malloc(8*4);
136+ // arr : *int = malloc(8*4);
132137
133- arr[2] = 72;
138+ // arr[2] = 72;
134139
135140 //puts("Hello World!");
136141
137142 ////modifyReference(x);
138143 //printint(x);
139144
140145 //newline();
141- putchar(arr[2]);
146+ // putchar(arr[2]);
142147
143- newline();
148+ // newline();
144149
145150 //if(1 || 0){
146151 // putchar(72);
Original file line number Diff line number Diff line change @@ -184,6 +184,6 @@ PipeOperatorTest :: module{
184184 return y*5;
185185 }
186186 pipeTest::int(z : int){
187- // return fnX(z) -> fnY(%);
187+ return fnX(z) -> fnY(%);
188188 }
189189}
You can’t perform that action at this time.
0 commit comments