| 2336 | } |
| 2337 | |
| 2338 | bool ParseTypedefExpr(Lexeme** str) |
| 2339 | { |
| 2340 | if(!ParseLexem(str, lex_typedef)) |
| 2341 | return false; |
| 2342 | if(!ParseSelectType(str)) |
| 2343 | ThrowError((*str)->pos, "ERROR: typename expected after typedef"); |
| 2344 | |
| 2345 | if(ParseSelectType(str)) |
| 2346 | ThrowError((*str - 1)->pos, "ERROR: there is already a type or an alias with the same name"); |
| 2347 | if((*str)->type != lex_string) |
| 2348 | ThrowError((*str)->pos, "ERROR: alias name expected after typename in typedef expression"); |
| 2349 | |
| 2350 | if((*str)->length >= NULLC_MAX_VARIABLE_NAME_LENGTH) |
| 2351 | ThrowError((*str)->pos, "ERROR: alias name length is limited to 2048 symbols"); |
| 2352 | AddAliasType(InplaceStr((*str)->pos, (*str)->length)); |
| 2353 | (*str)++; |
| 2354 | if(!ParseLexem(str, lex_semicolon)) |
| 2355 | ThrowError((*str)->pos, "ERROR: ';' not found after typedef"); |
| 2356 | return true; |
| 2357 | } |
| 2358 | |
| 2359 | bool ParseExpression(Lexeme** str) |
| 2360 | { |
no test coverage detected