jbcoe / jbcoe/mylang

Add if/else/elsif control flow

Open
#120 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

We should add control flow statements so that the following is valid

```
let mut x = 5;
if y > 0 { x = 3; }
elsif y < 0 { x = 4; }
else { x = 2; }
```

Maybe we should allow control flow to be an expression like it is in Rust? We can defer that.

Contributor guide

No contributing guide indexed for this repository

Research direction

A merged pull request (#132) is already linked to this issue. If revisiting the work, start by surveying the lexer and parser, then trace how statements reach the interpreter, JIT, AOT compiler, and runtime; the sample should parse and execute its if/elsif/else branches with the expression form remaining deferred.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.