| 2297 | } |
| 2298 | |
| 2299 | bool ParseVaribleSet(Lexeme** str) |
| 2300 | { |
| 2301 | if(!ParseTernaryExpr(str)) |
| 2302 | return false; |
| 2303 | |
| 2304 | Lexeme *curr = *str; |
| 2305 | if(ParseLexem(str, lex_set)) |
| 2306 | { |
| 2307 | if(ParseVaribleSet(str)) |
| 2308 | AddSetVariableNode((*str)->pos); |
| 2309 | else |
| 2310 | ThrowError((*str)->pos, "ERROR: expression not found after '='"); |
| 2311 | }else if((*str)->type >= lex_addset && (*str)->type <= lex_xorset){ |
| 2312 | (*str)++; |
| 2313 | CmdID cmdID[] = { cmdAdd, cmdSub, cmdMul, cmdDiv, cmdPow, cmdMod, cmdShl, cmdShr, cmdBitAnd, cmdBitOr, cmdBitXor }; |
| 2314 | const char *cmdName[] = { "+=", "-=", "*=", "/=", "**=", "%=", "<<=", ">>=", "&=", "|=", "^=" }; |
| 2315 | assert((unsigned)(curr->type - lex_addset) <= 10); |
| 2316 | if(ParseVaribleSet(str)) |
| 2317 | AddModifyVariableNode((*str)->pos, cmdID[curr->type - lex_addset], cmdName[curr->type - lex_addset]); |
| 2318 | else |
| 2319 | ThrowError((*str)->pos, "ERROR: expression not found after '%s' operator", cmdName[curr->type - lex_addset]); |
| 2320 | } |
| 2321 | |
| 2322 | return true; |
| 2323 | } |
| 2324 | |
| 2325 | bool ParseBlock(Lexeme** str) |
| 2326 | { |
no test coverage detected