feat: add logical OR operator with short-circuit evaluation and token support
Add TOKEN_PIPEPIPE token for '||' syntax, implement or() parsing function with CODE_OR bytecode, and add VM interpreter logic that short-circuits on truthy left operand. Update .gitignore to exclude *.xccheckout files, extend test coverage for falsy behavior in and.wren and if.wren, and add comprehensive or.wren test suite verifying short-circuit semantics and truthiness rules.
This commit is contained in:
@@ -18,3 +18,9 @@ io.write(true) && // expect: true
|
||||
// Swallow a trailing newline.
|
||||
io.write(true &&
|
||||
true) // expect: true
|
||||
|
||||
// Only false is falsy.
|
||||
io.write(0 && true) // expect: true
|
||||
io.write(null && true) // expect: true
|
||||
io.write("" && true) // expect: true
|
||||
io.write(false && true) // expect: false
|
||||
|
||||
Reference in New Issue
Block a user