Add support for variable (re)assignment #44

Open
opened 2023-06-02 20:18:51 +02:00 by samvv · 0 comments
samvv commented 2023-06-02 20:18:51 +02:00 (Migrated from github.com)

We have chosen := to mean assignment in our language.

let mut foo: Int

foo := 1

if toss.
  foo += foo

Implementation Strategy

  1. Create a new AssignStatement node
  2. Adjust the parser and scanner to be able to pick up the new node
  3. Handle AssignStatement in infer() in the type checker
We have chosen `:=` to mean assignment in our language. ``` let mut foo: Int foo := 1 if toss. foo += foo ``` ## Implementation Strategy 1. Create a new `AssignStatement` node 2. Adjust the parser and scanner to be able to pick up the new node 3. Handle `AssignStatement` in `infer()` in the type checker
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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: samvv/bolt#44
No description provided.