Retoor software development Projects Research SearchXNG
Register Sign In

6 lines
135 B
Plaintext
Raw Normal View History

feat: implement infix arithmetic operators for numbers and string concatenation Add parser support for +, -, *, / operators with correct precedence (term/factor) and emit method calls. Implement primitive methods for num_plus, num_minus, num_multiply, num_divide, and string_plus. Update VM to pass VM pointer to primitives and add unsupported value for type errors. Include test files for each operator.
2013-10-31 15:04:44 +01:00
io.write(8 / 2) // expect: 4
// TODO(bob): Floating point numbers.
// TODO(bob): Unsupported RHS types.
feat: implement modulo operator for numbers with fmod and add test suite Add num_mod primitive using fmod from math.h to support the % operator on number types. Register the new primitive in the numClass method table. Include a comprehensive test file covering positive, negative, and left-associative modulo cases, plus a divide-by-zero TODO comment in the existing division test.
2013-11-10 06:01:18 +01:00
// TODO(bob): Divide by zero.
Reference in New Issue Copy Permalink
c430056f70
wren/test/number_divide.wren
Response time: 53ms
Mail Licenses API