| 2279 | } |
| 2280 | |
| 2281 | bool ParseTernaryExpr(Lexeme** str) |
| 2282 | { |
| 2283 | const char *condPos = (*str)->pos; |
| 2284 | if(!ParseArithmetic(str)) |
| 2285 | return false; |
| 2286 | while(ParseLexem(str, lex_questionmark)) |
| 2287 | { |
| 2288 | if(!ParseVaribleSet(str)) |
| 2289 | ThrowError((*str)->pos, "ERROR: expression not found after '?'"); |
| 2290 | if(!ParseLexem(str, lex_colon)) |
| 2291 | ThrowError((*str)->pos, "ERROR: ':' not found after expression in ternary operator"); |
| 2292 | if(!ParseVaribleSet(str)) |
| 2293 | ThrowError((*str)->pos, "ERROR: expression not found after ':'"); |
| 2294 | AddIfElseTermNode(condPos); |
| 2295 | } |
| 2296 | return true; |
| 2297 | } |
| 2298 | |
| 2299 | bool ParseVaribleSet(Lexeme** str) |
| 2300 | { |
no test coverage detected