{"id":"language--if-else","name":"If, else if, and else","owner":"yeho","package":"language","kind":"language","signature":"if condition { ... }\nelse if condition { ... }\nelse { ... }","description":"if branches on a bool expression. Parentheses around the condition are optional, and each branch uses a block.","context":"Use if for a small number of ordered decisions. Use match when one value has several named shapes or cases.","parameters":[],"returns":"","members":[],"tags":["cpu","else","if","language","logic","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_statements.cpp parseIfStatement; conformance control.boolean-conditions"},"status":"stable","notes":["The condition must be bool.","Keep the most specific or highest-priority branch first."],"examples":[{"id":"complete","title":"Complete if, else if, and else example","description":"Use if for a small number of ordered decisions. Use match when one value has several named shapes or cases.","code":"int coins = 20\nif coins >= 15 { Console.Log(\"You can buy the shield\") }\nelse { Console.Log(\"Collect more coins\") }\n","tags":["cpu","language"],"run":"cpu-oracle","expected":null,"verifyRun":false,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.language__if_else\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","verification":"type checked","sha256":"eb5bbd8f31d0429ccb85d1cbe2644b1b0eb9e47de27f17a9dadf35f05bdf9ccf","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=language--if-else","json":"https://demonhunterlabs.com/reference/items/language--if-else.json","markdown":"https://demonhunterlabs.com/reference/text/language--if-else.md"}
