/[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 3034 by schoenebeck, Mon Oct 31 00:05:00 2016 UTC revision 3253 by schoenebeck, Tue May 30 12:08:45 2017 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014-2016 Christian Schoenebeck and Andreas Persson   * Copyright (c) 2014-2017 Christian Schoenebeck and Andreas Persson
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 31  Line 31 
31  %parse-param { LinuxSampler::ParserContext* context }  %parse-param { LinuxSampler::ParserContext* context }
32  %lex-param { void* scanner }  %lex-param { void* scanner }
33  // avoid symbol collision with other (i.e. future) auto generated (f)lex scanners  // avoid symbol collision with other (i.e. future) auto generated (f)lex scanners
34  %name-prefix "InstrScript_"  // (NOTE: "=" is deprecated here with Bison 3.x, however removing it would cause an error with Bison 2.x)
35    %name-prefix="InstrScript_"
36  %locations  %locations
37  %defines  %defines
38  %error-verbose  %error-verbose
# Line 506  assignment: Line 507  assignment:
507              PARSE_ERR(@1, (String("No variable declared with name '") + name + "'.").c_str());              PARSE_ERR(@1, (String("No variable declared with name '") + name + "'.").c_str());
508          else if (var->exprType() != INT_ARR_EXPR)          else if (var->exprType() != INT_ARR_EXPR)
509              PARSE_ERR(@2, (String("Variable '") + name + "' is not an array variable.").c_str());              PARSE_ERR(@2, (String("Variable '") + name + "' is not an array variable.").c_str());
510            else if (var->isConstExpr())
511                PARSE_ERR(@5, (String("Variable assignment: Cannot modify const array variable '") + name + "'.").c_str());
512            else if (!var->isAssignable())
513                PARSE_ERR(@5, (String("Variable assignment: Array variable '") + name + "' is not assignable.").c_str());
514          else if ($3->exprType() != INT_EXPR)          else if ($3->exprType() != INT_EXPR)
515              PARSE_ERR(@3, (String("Array variable '") + name + "' accessed with non integer expression.").c_str());              PARSE_ERR(@3, (String("Array variable '") + name + "' accessed with non integer expression.").c_str());
516          else if ($6->exprType() != INT_EXPR)          else if ($6->exprType() != INT_EXPR)
# Line 837  int InstrScript_tnamerr(char* yyres, con Line 842  int InstrScript_tnamerr(char* yyres, con
842      }      }
843    
844    if (! yyres)    if (! yyres)
845      return yystrlen (yystr);      return (int) yystrlen (yystr);
846    
847    return yystpcpy (yyres, yystr) - yyres;    return int( yystpcpy (yyres, yystr) - yyres );
848  }  }

Legend:
Removed from v.3034  
changed lines
  Added in v.3253

  ViewVC Help
Powered by ViewVC