/[svn]/linuxsampler/trunk/src/scriptvm/parser.y
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/parser.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3785 by schoenebeck, Sat Feb 1 18:11:20 2020 UTC revision 3786 by schoenebeck, Sun Jun 7 15:39:31 2020 UTC
# Line 779  assignment: Line 779  assignment:
779              else if (numberVar->isFinal() != expr->isFinal())              else if (numberVar->isFinal() != expr->isFinal())
780                  PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' was declared as " + String(numberVar->isFinal() ? "final" : "not final") + ", assignment is " + String(expr->isFinal() ? "final" : "not final") + " though.").c_str());                  PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' was declared as " + String(numberVar->isFinal() ? "final" : "not final") + ", assignment is " + String(expr->isFinal() ? "final" : "not final") + " though.").c_str());
781          }          }
782          $$ = new Assignment(var, $3);  
783            if (var)
784                $$ = new Assignment(var, $3);
785            else
786                $$ = new NoOperation;
787      }      }
788      | VARIABLE '[' expr ']' ASSIGNMENT expr  {      | VARIABLE '[' expr ']' ASSIGNMENT expr  {
789          const char* name = $1;          const char* name = $1;
# Line 809  assignment: Line 813  assignment:
813                            ToString(((ArrayExprRef)var)->arraySize()) + ".").c_str());                            ToString(((ArrayExprRef)var)->arraySize()) + ".").c_str());
814          else if ($3->asInt()->isFinal())          else if ($3->asInt()->isFinal())
815              PARSE_WRN(@3, "Final operator '!' is meaningless here.");              PARSE_WRN(@3, "Final operator '!' is meaningless here.");
816          if (var->exprType() == INT_ARR_EXPR) {  
817            if (!var) {
818                $$ = new NoOperation;
819            } else if (var->exprType() == INT_ARR_EXPR) {
820              IntArrayElementRef element = new IntArrayElement(var, $3);              IntArrayElementRef element = new IntArrayElement(var, $3);
821              $$ = new Assignment(element, $6);              $$ = new Assignment(element, $6);
822          } else if (var->exprType() == REAL_ARR_EXPR) {          } else if (var->exprType() == REAL_ARR_EXPR) {
823              RealArrayElementRef element = new RealArrayElement(var, $3);              RealArrayElementRef element = new RealArrayElement(var, $3);
824              $$ = new Assignment(element, $6);              $$ = new Assignment(element, $6);
         } else {  
             $$ = new NoOperation; // actually not possible to ever get here  
825          }          }
826      }      }
827    

Legend:
Removed from v.3785  
changed lines
  Added in v.3786

  ViewVC Help
Powered by ViewVC