Commit Graph

2 Commits

Author SHA1 Message Date
Bob Nystrom
0ea34e00fe 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.
2013-11-10 05:32:57 +00:00
Bob Nystrom
5fb2b6b253 feat: add io.write primitive and test runner with number literal tests
Implement the io.write() primitive function that prints a value followed by a newline, enabling basic output for testing. Add a Python test runner script (runtests) that discovers and executes .wren test files, comparing output against // expect: comments. Include initial number literal tests covering positive, negative, and zero values. Remove debug print statements from the VM interpreter and refactor primitive registration macros for cleaner code.
2013-10-28 05:45:40 +00:00