Closed n-arms closed 3 years ago
By default the ExpressionSyntax.eval() method returns a double, which wouldn't work with a boolean. Similarly, compiling for graphing (#3 ), would involve reducing as much as possible to just constants. It would thus make sense to remove the old eval method and create a new one which returns a tree that is as reduced as possible, a combination of the old eval and reduce methods.
Description
Handling boolean comparisons between numbers, as well as true/false key variables
Implementation
The lexer should have a static list of keywords, and whenever it detects a would-be symbol with the text of that keyword, it creates a keyword token instead. This includes true and false, which are then handled by the Parser during Parser.parseLiteral().