feat: add conditional operator and fn toString to wren compiler and core
Add TOKEN_QUESTION token type and implement conditional() parsing function in wren_compiler.c to support the ternary conditional operator (condition ? then : else). Register fn_toString native in wren_core.c to return "<fn>" string for function objects. Include comprehensive test suite covering precedence, short-circuit evaluation, and error cases for missing tokens.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
1 ? 2 ? 3 : 4 : 5 // expect error
|
||||
Reference in New Issue
Block a user