Implement loops #4

Merged
samsonium merged 24 commits from feat-loops into v1.1 2026-10-25 02:01:47 +00:00
Owner
No description provided.
Author
Owner

Add test for loops inside function and "while object is not null"

Add test for loops inside function and "while object is not null"
samsonium left a comment
Author
Owner

to be continued

to be continued
@@ -0,0 +5,4 @@
// 2. Change variable value:
someString = "hello, world!";
// Variables helps you store values to use it later
Author
Owner

help

*help*
@@ -0,0 +13,4 @@
printline("Now we got 12:");
printline(c);
// Also, there is many different types to help your program
Author
Owner
  • there are
  • variable types
- *there are* - *variable types*
@@ -0,0 +1,30 @@
// When you need to check some value
// a conditional statements might help you
Author
Owner

statemenT

*statemenT*
@@ -0,0 +7,4 @@
printline("Yay! 2 + 2 = 4");
}
// Conditional statement uses condition in pairs
Author
Owner

parenthesis, not pairs

*parenthesis*, not *pairs*
@@ -0,0 +11,4 @@
ssize_t check_top;
fzl_nodetype_t check_tree[256];
void ghost_walk_changed(fzl_node_t *node, bool *changed, fzl_sym_t *sym)
Author
Owner

Add comment

Add comment
@@ -979,0 +1019,4 @@
{
fzl_token_t *tok = consume(parser);
fzl_token_t *lpar = consume(parser);
if (lpar->type != FZL_TOKTYPE_LPAREN)
Author
Owner

Add lpar null-check

Add `lpar` null-check
@@ -979,0 +1201,4 @@
// `break` keyword parsing
fzl_node_t *parse_break(fzl_parser_t *parser)
{
fzl_token_t *tok = consume(parser);
Author
Owner

Add tok null-check

Add `tok` null-check
@@ -203,0 +330,4 @@
for (size_t i = walker->sym_top - 1; i > newctx->initial_env_lvl; i--)
fzl_freesymt(walker->syms[--walker->sym_top]);
free(newctx->breaks);
Author
Owner

move free to section under the backpatching cycle

move `free` to section under the backpatching cycle
samsonium marked this conversation as resolved
@@ -0,0 +21,4 @@
else
{
age = 20;
printline("You looks too young!");
Author
Owner

look

look
src/vm/fzl_vm.c Outdated
@@ -15,1 +16,4 @@
char last_err[256];
size_t last_jmp_ip = 0;
// NOTE: add `--max-iter` option for limit
Author
Owner

implement "--max-iter" options (in arg parser)

implement "--max-iter" options (in arg parser)
samsonium changed target branch from master to v1.1 2026-10-25 01:58:33 +00:00
samsonium added 24 commits 2026-10-25 01:58:33 +00:00
samsonium merged commit 562b1b2e0a into v1.1 2026-10-25 02:01:47 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: samsonium/fz-lang#4