Skip to content

Commit 297f908

Browse files
authored
Merge pull request #33 from callisto-lang/Pointers
Pointers
2 parents 7c3fadc + a9c815e commit 297f908

File tree

15 files changed

+870
-506
lines changed

15 files changed

+870
-506
lines changed

TODO.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@
22
- For loops
33
- Make if/while have a scope
44
- move global constructor calls to let statement
5+
- Make constructors and destructors work on aliased and inherited types
6+
- I think renamed externs are broken?
7+
8+
## Pointers
9+
Functions `CompileFuncDef`, `CompileLet`, `CompileArray`, `CompileExtern` must be updated
10+
- Add support for them when using constructors and destructors

editors/micro_callisto.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rules:
77
- statement: "\\b(func|end|begin|asm|include|inline|if|then|elseif|else|while|do)\\b"
88
- statement: "\\b(let|enable|requires|struct|version|return|const|enum|restrict)\\b"
99
- statement: "\\b(continue|break|union|alias|overwrite|error|extern|call|raw)\\b"
10-
- statement: "\\b(implement|as|try|catch|throw|unsafe|man)\\b"
10+
- statement: "\\b(implement|as|try|catch|throw|unsafe|man|ptr)\\b"
1111
- type: "\\b(addr|void|u8|i8|u16|i16|u32|i32|u64|i64|size|usize|cell|array)\\b"
1212

1313
- constant.string:

examples/alias.cal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include "cores/select.cal"
22
include "std/io.cal"
33

44
alias int cell
5-
"int.sizeof = " printstr int.sizeof printdec new_line
5+
"int.sizeof = " printstr int.sizeOf printdec new_line
66

77
let int myInt
88
65 -> myInt

examples/fib.cal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ include "std/io.cal"
33

44
func fib cell n -> cell res begin
55
if n 1 <= then
6-
n return
6+
n
77
else
88
n 1 - fib
99
n 2 - fib
10-
+ return
10+
+
1111
end
1212
end
1313

examples/inheritance.cal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct Building : Thing
1010
end
1111

1212
"Thing.name = " printstr Thing.name printdec new_line
13-
"Thing.sizeof = " printstr Thing.sizeof printdec new_line
13+
"Thing.sizeof = " printstr Thing.sizeOf printdec new_line
1414
"Building.name = " printstr Building.name printdec new_line
1515
"Building.numWindows = " printstr Building.numWindows printdec new_line
16-
"Building.sizeof = " printstr Building.sizeof printdec new_line
16+
"Building.sizeof = " printstr Building.sizeOf printdec new_line

examples/tak.cal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ func tak cell x cell y cell z -> cell res begin
1212
end
1313
end
1414

15-
7 4 8 tak printdec 10 printch
15+
48 20 12 tak printdec 10 printch

examples/unions.cal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ union MyUnion
66
Array
77
end
88

9-
"MyUnion.sizeof = " printstr MyUnion.sizeof printdec new_line
9+
"MyUnion.sizeof = " printstr MyUnion.sizeOf printdec new_line
1010

1111
let MyUnion foo
1212

0 commit comments

Comments
 (0)