Implement Control Flow Statements in Kym #37

Merged
kayomn merged 8 commits from kym-control-flow into main 2023-08-26 00:01:25 +02:00
Owner

Introduces basic while loop and if / elif / else control flow.

To be expanded on in the future, however this is enough to get started.

while i < 5:
	@print("hello, world")

	i = i + 1
end

if i > 6:
	@print("`i` greater than `6`")
elif i == 4:
	@print("`i` is equal to `4`")
else:
	@print("i'unno")
end

Closes #23.

Currently blocked by a miscompilation in the Zig compiler and pending a resolution for that before work this can proceed any further.

Introduces basic `while` loop and `if` / `elif` / `else` control flow. To be expanded on in the future, however this is enough to get started. ```rb while i < 5: @print("hello, world") i = i + 1 end if i > 6: @print("`i` greater than `6`") elif i == 4: @print("`i` is equal to `4`") else: @print("i'unno") end ``` Closes #23. ~~Currently blocked by a miscompilation in the Zig compiler and pending a resolution for that before work this can proceed any further.~~
kayomn added this to the (deleted) milestone 2023-08-20 18:43:47 +02:00
kayomn self-assigned this 2023-08-20 18:43:47 +02:00
kayomn added 1 commit 2023-08-20 18:43:48 +02:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2d016dc085
Implement if statements in AST and jumps in the VM
kayomn added 1 commit 2023-08-20 23:25:42 +02:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
0d6e5250c7
Refactor Kym AST
kayomn added 2 commits 2023-08-22 00:51:55 +02:00
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
eca2cfffb8
Fix off-by-one if statement jump error
kayomn added 1 commit 2023-08-23 00:49:28 +02:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
bb1e689c5a
Add while loops
kayomn added 3 commits 2023-08-25 23:57:40 +02:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
77af4d067b
Fix > and == operators being miscompiled
kayomn changed title from WIP: Implement Control Flow Statements in Kym to Implement Control Flow Statements in Kym 2023-08-26 00:01:12 +02:00
kayomn merged commit 1e3f676698 into main 2023-08-26 00:01:25 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kayomn/ona#37
No description provided.