File tree Expand file tree Collapse file tree 6 files changed +77
-4
lines changed Expand file tree Collapse file tree 6 files changed +77
-4
lines changed Original file line number Diff line number Diff line change 8
8
- statement : " \\ b(let|enable|requires|struct|version|return|const|enum|restrict)\\ b"
9
9
- statement : " \\ b(continue|break|union|alias|overwrite|error|extern|call|raw)\\ b"
10
10
- statement : " \\ b(implement|as|try|catch|throw|unsafe|man|ptr|anon)\\ b"
11
- - type : " \\ b(addr|void|u8|i8|u16|i16|u32|i32|u64|i64|size|usize|cell|array)\\ b"
11
+ - type : " \\ b(addr|void|u8|i8|u16|i16|u32|i32|u64|i64|size|usize|cell|array|bool )\\ b"
12
12
- type : " \\ b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\ b"
13
13
14
14
- constant.string :
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # this is a cat program
2
+
3
+ include "cores/select.cal"
4
+ include "std/io.cal"
5
+ include "std/args.cal"
6
+ include "uxn/file.cal"
7
+
8
+ if get_args_length 1 = then
9
+ "Please pass a file name" print_str new_line
10
+ 0 exit
11
+ end
12
+
13
+ let Array fileName
14
+ 1 &fileName get_arg
15
+ &fileName 0 uxn_open_file
16
+
17
+ let u8 ch
18
+ while true do
19
+ &ch 1 0 try uxn_read_file
20
+ catch
21
+ 0 exit
22
+ end
23
+
24
+ ch print_ch
25
+ end
Original file line number Diff line number Diff line change
1
+ include "cores/select.cal"
2
+ include "std/io.cal"
3
+ include "uxn/uxn.cal"
4
+ include "uxn/screen.cal"
5
+ include "uxn/system.cal"
6
+
7
+ let bool drawn
8
+ let cell w
9
+ let cell h
10
+
11
+ func plot cell x cell y cell colour begin
12
+ x uxn_screen_set_x
13
+ y uxn_screen_set_y
14
+ colour 0 uxn_pixel_set_colour uxn_set_pixel
15
+ end
16
+
17
+ func screen_vector begin
18
+ if drawn not then
19
+ let cell x
20
+ let cell y
21
+
22
+ while y h < do
23
+ 0 -> x
24
+ while x w < do
25
+ if x y and 0 = then
26
+ x y 1 plot
27
+ end
28
+
29
+ x 1 + -> x
30
+ end
31
+
32
+ y 1 + -> y
33
+ end
34
+
35
+ 1 -> drawn
36
+ end
37
+
38
+ uxn_brk
39
+ end
40
+
41
+ uxn_get_screen_size -> h -> w
42
+
43
+ 0x0FFF uxn_set_red
44
+ 0x0FFF uxn_set_green
45
+ 0x0FFF uxn_set_blue
46
+ &screen_vector uxn_set_screen_vector
47
+
48
+ uxn_brk
Original file line number Diff line number Diff line change @@ -226,9 +226,9 @@ class StackChecker {
226
226
}
227
227
228
228
foreach (i, ref cond ; node.condition) {
229
- if (cond.empty()) {
230
- Error(node.error, " Empty condition in if statement" );
231
- }
229
+ // if (cond.empty()) {
230
+ // Error(node.error, "Empty condition in if statement");
231
+ // }
232
232
233
233
StackCell[] oldStack;
234
234
You can’t perform that action at this time.
0 commit comments