feat: implement floating-point number literal parsing and arithmetic operations
Add support for floating-point number literals in the parser by detecting decimal points with trailing digits in `readNumber()`, and switch the compiler's `number()` function from `strtol` to `strtod` for proper double conversion. Update the `num_abs` primitive to use `fabs()` instead of manual negation. Extend test coverage across arithmetic, comparison, equality, modulus, and string conversion tests with floating-point cases, and add a new test for decimal point at end-of-file error detection.
This commit is contained in:
@@ -15,3 +15,4 @@ io.write(2 >= 2) // expect: true
|
||||
io.write(2 >= 1) // expect: true
|
||||
|
||||
// TODO(bob): Wrong type for RHS.
|
||||
// TODO(bob): Comparing zero and negative zero.
|
||||
|
||||
Reference in New Issue
Block a user