| 1815 | } |
| 1816 | |
| 1817 | bool ParseVariable(Lexeme** str, bool *lastIsFunctionCall = NULL) |
| 1818 | { |
| 1819 | if(ParseLexem(str, lex_mul)) |
| 1820 | { |
| 1821 | if(!ParseTerminal(str)) |
| 1822 | ThrowError((*str)->pos, "ERROR: variable name not found after '*'"); |
| 1823 | AddGetVariableNode((*str)->pos, true); |
| 1824 | return true; |
| 1825 | } |
| 1826 | |
| 1827 | if((*str)->type != lex_string || (*str)[1].type == lex_oparen) |
| 1828 | return false; |
| 1829 | |
| 1830 | NamespaceInfo* lastNS = GetCurrentNamespace(); |
| 1831 | SetCurrentNamespace(NULL); |
| 1832 | NamespaceInfo* ns = NULL; |
| 1833 | while((*str)->type == lex_string && (*str + 1)->type == lex_point && (ns = IsNamespace(InplaceStr((*str)->pos, (*str)->length))) != NULL) |
| 1834 | { |
| 1835 | (*str)++; |
| 1836 | if(!ParseLexem(str, lex_point)) |
| 1837 | ThrowError((*str)->pos, "ERROR: '.' not found after namespace name"); |
| 1838 | SetCurrentNamespace(ns); |
| 1839 | } |
| 1840 | |
| 1841 | if((*str)->length >= NULLC_MAX_VARIABLE_NAME_LENGTH) |
| 1842 | ThrowError((*str)->pos, "ERROR: variable name length is limited to 2048 symbols"); |
| 1843 | AddGetAddressNode((*str)->pos, InplaceStr((*str)->pos, (*str)->length)); |
| 1844 | (*str)++; |
| 1845 | SetCurrentNamespace(lastNS); |
| 1846 | |
| 1847 | bool isFuncCall = false; |
| 1848 | while(ParsePostExpression(str, &isFuncCall)); |
| 1849 | if(lastIsFunctionCall) |
| 1850 | *lastIsFunctionCall = isFuncCall; |
| 1851 | return true; |
| 1852 | } |
| 1853 | |
| 1854 | bool ParsePostExpression(Lexeme** str, bool *isFunctionCall = NULL) |
| 1855 | { |
no test coverage detected