This repository was archived by the owner on Sep 14, 2024. It is now read-only.
This repository was archived by the owner on Sep 14, 2024. It is now read-only.
Inconsistent value comparisons #164
Open
Description
This is definitely a bug. I'm writing unit tests for my math interpreter and when attempting the following test it fails:
local lexer = Lexer.new('4.2 - 3.8')
lexer:tokenize()
local tree = Parser.new(lexer):parse()
local value = Interpreter:visit(tree)
expect(value).to.be.equal(0.4)
The values are identical. Of the 20+ tests I'm running this is the only one that fails. I'm really not sure why it is. I've triple checked my interpreter and the value is always returned correctly. This error only appears to occur with the subtract binary operation.
Metadata
Metadata
Assignees
Labels
No labels