Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (expr[i].type == "op") {
- if (expr[i].specifier == "+" ||
- expr[i].specifier == "-" ||
- expr[i].specifier == "*" ||
- expr[i].specifier == "/")
- {
- if ((expr[i - 1].type == "int" ||
- expr[i - 1].type == "float" ||
- expr[i - 1].type == "string" ||
- expr[i - 1].type == "var_int" ||
- expr[i - 1].type == "var_float" ||
- expr[i - 1].type == "var_string" ||
- expr[i - 1].type == "func" ||
- expr[i - 1].type == "user_func" ||
- expr[i - 1].specifier == ")")
- &&
- (expr[i + 1].type == "int" ||
- expr[i + 1].type == "float" ||
- expr[i + 1].type == "string" ||
- expr[i + 1].type == "var_int" ||
- expr[i + 1].type == "var_float" ||
- expr[i + 1].type == "var_string" ||
- expr[i + 1].type == "func" ||
- expr[i + 1].type == "user_func" ||
- expr[i + 1].specifier == "("))
- {
- }
- else {
- std::cout << ">>> SYNTAX ERROR: invalid operator placement. (Operator)" << std::endl;
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement