387 std::vector<std::string> operations;
394 auto full_operation = operation;
395 auto tmp_operation = operation;
396 if (operation !=
"=")
397 operation = operation.substr(0, operation.size() - 1);
399 throw std::exception(
"Cannot apply assignment operator to rvalue");
401 throw std::exception(
"Cannot apply assignment operator to const");
406 operations.push_back(full_operation);
408 throw std::exception((
"Cannot apply " + tmp_operation +
" operator with " +
semantic.
type_to_string(prev) +
414 for (
int i = (
int)operations.size() - 1; i >= 0; --i) {
606 std::vector<std::string> operations;
613 for (
int i = (
int)operations.size() - 1; i >= 0; --i) {
619 for (
int i = operations.size() - 1; i >= 0; --i) {
620 if (curr.first.is_array)
621 throw std::exception((
"Cannot apply " + operations[i] +
" operator to " +
semantic.
type_to_string(curr.first)).c_str());
622 if (operations[i] ==
"+" || operations[i] ==
"-" || operations[i] ==
"~") {
625 throw std::exception((
"Cannot apply " + operations[i] +
" operator to " +
semantic.
type_to_string(curr.first)).c_str());
627 }
else if (operations[i] ==
"!") {
629 throw std::exception((
"Cannot apply " + operations[i] +
" operator to " +
semantic.
type_to_string(curr.first)).c_str());
634 throw std::exception((
"Cannot apply " + operations[i] +
" operator to " +
semantic.
type_to_string(curr.first)).c_str());
636 throw std::exception((
"Cannot apply " + operations[i] +
" operator to rvalue").c_str());
637 if (curr.first.is_const)
638 throw std::exception((
"Cannot apply " + operations[i] +
" operator to const").c_str());