Skip to content

Commit

Permalink
fix + 0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yeti0904 committed Dec 6, 2024
1 parent 328502c commit 11a0f42
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import callisto.backends.rm86;
import callisto.backends.arm64;
import callisto.backends.x86_64;

const static string appVersion = "Beta 0.12.0";
const static string appVersion = "Beta 0.12.1";

const static string usage = "
Callisto Compiler
Expand Down
6 changes: 3 additions & 3 deletions source/backends/arm64.d
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ class BackendARM64 : CompilerBackend {
NewConst("Array.length", 0);
NewConst("Array.memberSize", 8);
NewConst("Array.elements", 16);
NewConst("Array.sizeof", 8 * 3);
NewConst("Array.sizeOf", 8 * 3);

types ~= Type("Exception", 24 + 8, true, [
StructEntry(UsedType(GetType("bool"), false), "error"),
StructEntry(UsedType(GetType("Array"), false), "msg")
]);
NewConst("Exception.bool", 0);
NewConst("Exception.msg", 8);
NewConst("Exception.sizeof", 24 + 8);
NewConst("Exception.sizeOf", 24 + 8);

globals ~= Global(
"_cal_exception", UsedType(GetType("Exception"), false), false, 0
);

foreach (ref type ; types) {
NewConst(format("%s.sizeof", type.name), cast(long) type.size);
NewConst(format("%s.sizeOf", type.name), cast(long) type.size);
}
}

Expand Down
6 changes: 3 additions & 3 deletions source/backends/lua.d
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ class BackendLua : CompilerBackend {
NewConst("Array.length", 0);
NewConst("Array.memberSize", 1);
NewConst("Array.elements", 2);
NewConst("Array.sizeof", 3);
NewConst("Array.sizeOf", 3);

types ~= Type("Exception", 3 + 1, true, [
StructEntry(UsedType(GetType("bool"), false), "error"),
StructEntry(UsedType(GetType("Array"), false), "msg")
]);
NewConst("Exception.bool", 0);
NewConst("Exception.msg", 1);
NewConst("Exception.sizeof", 3 + 1);
NewConst("Exception.sizeOf", 3 + 1);

foreach (ref type ; types) {
NewConst(format("%s.sizeof", type.name), cast(long) type.size);
NewConst(format("%s.sizeOf", type.name), cast(long) type.size);
}

globals ~= Global(
Expand Down
6 changes: 3 additions & 3 deletions source/backends/rm86.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ class BackendRM86 : CompilerBackend {
NewConst("Array.length", 0);
NewConst("Array.memberSize", 2);
NewConst("Array.elements", 4);
NewConst("Array.sizeof", 2 * 3);
NewConst("Array.sizeOf", 2 * 3);

types ~= Type("Exception", 6 + 2, true, [
StructEntry(UsedType(GetType("bool"), false), "error"),
StructEntry(UsedType(GetType("Array"), false), "msg")
]);
NewConst("Exception.bool", 0);
NewConst("Exception.msg", 2);
NewConst("Exception.sizeof", 6 + 2);
NewConst("Exception.sizeOf", 6 + 2);

foreach (ref type ; types) {
NewConst(format("%s.sizeof", type.name), cast(long) type.size);
NewConst(format("%s.sizeOf", type.name), cast(long) type.size);
}

globals ~= Global(
Expand Down
6 changes: 3 additions & 3 deletions source/backends/uxn.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ class BackendUXN : CompilerBackend {
NewConst("Array.length", 0);
NewConst("Array.memberSize", 2);
NewConst("Array.elements", 4);
NewConst("Array.sizeof", 2 * 3);
NewConst("Array.sizeOf", 2 * 3);

types ~= Type("Exception", 6 + 2, true, [
StructEntry(UsedType(GetType("bool"), false), "error"),
StructEntry(UsedType(GetType("Array"), false), "msg")
]);
NewConst("Exception.bool", 0);
NewConst("Exception.msg", 2);
NewConst("Exception.sizeof", 6 + 2);
NewConst("Exception.sizeOf", 6 + 2);

foreach (ref type ; types) {
NewConst(format("%s.sizeof", type.name), cast(long) type.size);
NewConst(format("%s.sizeOf", type.name), cast(long) type.size);
}

globals ~= Global(
Expand Down
6 changes: 3 additions & 3 deletions source/backends/x86_64.d
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ class BackendX86_64 : CompilerBackend {
NewConst("Array.length", 0);
NewConst("Array.memberSize", 8);
NewConst("Array.elements", 16);
NewConst("Array.sizeof", 8 * 3);
NewConst("Array.sizeOf", 8 * 3);

types ~= Type("Exception", 24 + 8, true, [
StructEntry(UsedType(GetType("bool"), false), "error"),
StructEntry(UsedType(GetType("Array"), false), "msg")
]);
NewConst("Exception.error", 0);
NewConst("Exception.msg", 8);
NewConst("Exception.sizeof", 24 + 8);
NewConst("Exception.sizeOf", 24 + 8);

foreach (ref type ; types) {
NewConst(format("%s.sizeof", type.name), cast(long) type.size);
NewConst(format("%s.sizeOf", type.name), cast(long) type.size);
}

globals ~= Global(
Expand Down
4 changes: 2 additions & 2 deletions source/compiler.d
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class CompilerBackend {
}

types ~= Type(node.name, maxSize);
NewConst(format("%s.sizeof", node.name), cast(long) maxSize);
NewConst(format("%s.sizeOf", node.name), cast(long) maxSize);
}

void CompileAlias(AliasNode node) {
Expand All @@ -248,7 +248,7 @@ class CompilerBackend {
baseType.name = node.to;
types ~= baseType;

NewConst(format("%s.sizeof", node.to), cast(long) GetType(node.to).size);
NewConst(format("%s.sizeOf", node.to), cast(long) GetType(node.to).size);
}

final void Error(Char, A...)(ErrorInfo error, in Char[] fmt, A args) {
Expand Down

0 comments on commit 11a0f42

Please sign in to comment.