Skip to content

Commit

Permalink
Merge pull request #33 from callisto-lang/Pointers
Browse files Browse the repository at this point in the history
Pointers
  • Loading branch information
MESYETI authored Dec 6, 2024
2 parents 7c3fadc + a9c815e commit 297f908
Show file tree
Hide file tree
Showing 15 changed files with 870 additions and 506 deletions.
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
- For loops
- Make if/while have a scope
- move global constructor calls to let statement
- Make constructors and destructors work on aliased and inherited types
- I think renamed externs are broken?

## Pointers
Functions `CompileFuncDef`, `CompileLet`, `CompileArray`, `CompileExtern` must be updated
- Add support for them when using constructors and destructors
2 changes: 1 addition & 1 deletion editors/micro_callisto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rules:
- statement: "\\b(func|end|begin|asm|include|inline|if|then|elseif|else|while|do)\\b"
- statement: "\\b(let|enable|requires|struct|version|return|const|enum|restrict)\\b"
- statement: "\\b(continue|break|union|alias|overwrite|error|extern|call|raw)\\b"
- statement: "\\b(implement|as|try|catch|throw|unsafe|man)\\b"
- statement: "\\b(implement|as|try|catch|throw|unsafe|man|ptr)\\b"
- type: "\\b(addr|void|u8|i8|u16|i16|u32|i32|u64|i64|size|usize|cell|array)\\b"

- constant.string:
Expand Down
2 changes: 1 addition & 1 deletion examples/alias.cal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include "cores/select.cal"
include "std/io.cal"

alias int cell
"int.sizeof = " printstr int.sizeof printdec new_line
"int.sizeof = " printstr int.sizeOf printdec new_line

let int myInt
65 -> myInt
Expand Down
4 changes: 2 additions & 2 deletions examples/fib.cal
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ include "std/io.cal"

func fib cell n -> cell res begin
if n 1 <= then
n return
n
else
n 1 - fib
n 2 - fib
+ return
+
end
end

Expand Down
4 changes: 2 additions & 2 deletions examples/inheritance.cal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Building : Thing
end

"Thing.name = " printstr Thing.name printdec new_line
"Thing.sizeof = " printstr Thing.sizeof printdec new_line
"Thing.sizeof = " printstr Thing.sizeOf printdec new_line
"Building.name = " printstr Building.name printdec new_line
"Building.numWindows = " printstr Building.numWindows printdec new_line
"Building.sizeof = " printstr Building.sizeof printdec new_line
"Building.sizeof = " printstr Building.sizeOf printdec new_line
2 changes: 1 addition & 1 deletion examples/tak.cal
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ func tak cell x cell y cell z -> cell res begin
end
end

7 4 8 tak printdec 10 printch
48 20 12 tak printdec 10 printch
2 changes: 1 addition & 1 deletion examples/unions.cal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ union MyUnion
Array
end

"MyUnion.sizeof = " printstr MyUnion.sizeof printdec new_line
"MyUnion.sizeof = " printstr MyUnion.sizeOf printdec new_line

let MyUnion foo

Expand Down
Loading

0 comments on commit 297f908

Please sign in to comment.