Skip to content

Commit 7b574ff

Browse files
committed
Raylib example runs
1 parent 8ae412b commit 7b574ff

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Release/*
1515
out/*
1616
.vs/*
1717
*.o
18-
.vscode/*
18+
.vscode/*
19+
.VSCodeCounter/*

mfiles/raylib.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
let str = "Hello, World!";
3+
4+
let InitWindow = extern raylib::InitWindow(w: Int, h: Int, s: String): Void;
5+
InitWindow(800, 600, str);
6+
7+
let SetTargetFPS = extern raylib::SetTargetFPS(fps: Int): Void;
8+
SetTargetFPS(60);
9+
10+
let WindowShouldClose = extern raylib::WindowShouldClose(): Bool;
11+
let CloseWindow = extern raylib::CloseWindow(): Void;
12+
13+
let BeginDrawing = extern raylib::BeginDrawing(): Void;
14+
let ClearBackground = extern raylib::ClearBackground(color: Int): Void;
15+
let EndDrawing = extern raylib::EndDrawing(): Void;
16+
17+
let DrawText = extern raylib::DrawText(text: String, x: Int, y: Int, fontSize: Int, color: Int): Void;
18+
19+
while(WindowShouldClose() == false) {
20+
BeginDrawing();
21+
ClearBackground(1);
22+
DrawText(str, 190, 200, 20, 1);
23+
EndDrawing();
24+
}
25+
26+
CloseWindow();
27+
28+
ret 0;

mfiles/str.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
let s = "Hello, World!";
44
let str = s;
55

6-
let print = extern test::print(s: Str): Void;
6+
let print = extern test::print(s: String): Void;
77
print(str);

src/mains/MLang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int main(int argc, char** argv) {
1919
mlang.settings.showFileContent = false;
2020
mlang.settings.showResult = false;
2121
mlang.settings.showAbastractSyntaxTree = false;
22+
mlang.settings.showTypeInference = false;
2223
mlang.settings.showInferedTypes = false;
2324
mlang.settings.showFunctions = false;
2425
mlang.settings.showEmission = false;

src/transformer/InfereIdentifierTypes.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ InfereIdentifierTypes::InfereIdentifierTypes() {
2828

2929
DEF_BUILD_IN("||", Bool);
3030
DEF_BUILD_IN("&&", Bool);
31+
DEF_BUILD_IN("==", Bool);
32+
DEF_BUILD_IN("!=", Bool);
33+
34+
DEF_BUILD_IN("==", String);
35+
DEF_BUILD_IN("!=", String);
3136

3237
stack.push_back({});
3338
}

0 commit comments

Comments
 (0)