Skip to content

Let statement on compiler repl gives out a value and not null #6

@Yag000

Description

@Yag000

Description

When using the compiler on the REPL, I get a value different from null when assigning variables with a let statement."

Steps to reproduce

cargo run

and simply type

let a = 4;

Expected behavior

Welcome to the Monkey programming language! Compiler and Interpreter by @Yag000, in Rust
Feel free to type in commands

>> let a = 4;

Actual behavior

Welcome to the Monkey programming language! Compiler and Interpreter by @Yag000, in Rust
Feel free to type in commands

>> let a = 4;
4

Additional information

This only happens when using the compiler as an engine. This is due to the fact that 4 is at the top of the stack, which is not an intended behavior in this case. NULL should be there. I will look at this later as it does not have any practical implications, and it will not mess with anyone, but it should be addressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompilerIssues about the compiler itselfgood first issueGood for newcomersreplREPL related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions