Files
hakorune/apps/tests/ternary_nested.nyash
Selfhosting Dev 5cad0ab20c 🔧 Fix peek expression terminator issues and add ternary operator support
- Fix LLVM IR terminator missing in peek expression entry blocks
- Add proper jump instructions between peek blocks
- Implement ternary operator (? :) as syntactic sugar for peek
- Update Python LLVM externcall handling for improved compatibility
- Add comprehensive test cases for peek and ternary expressions
- Update language guide with ternary operator documentation

ChatGPTが頑張って修正してくれたにゃ!🐱

Co-Authored-By: ChatGPT <noreply@openai.com>
2025-09-14 20:30:38 +09:00

11 lines
179 B
Plaintext

static box Main {
main(args) {
local a = 3
local b = 5
// Nested ternary: should evaluate to 50
local v = (a < b) ? ((b < 0) ? 40 : 50) : 60
return v
}
}