/[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 3815 by schoenebeck, Thu Aug 6 12:15:02 2020 UTC revision 3816 by schoenebeck, Fri Aug 28 17:28:48 2020 UTC
# Line 908  unary_expr: Line 908  unary_expr:
908          $$ = $1;          $$ = $1;
909      }      }
910      | '+' unary_expr  {      | '+' unary_expr  {
911          $$ = $2;          if (isNumber($2->exprType())) {
912                $$ = $2;
913            } else {
914                PARSE_ERR(@2, (String("Unary '+' operator requires number, is ") + typeStr($2->exprType()) + " though.").c_str());
915                $$ = new IntLiteral({ .value = 0 });
916            }
917      }      }
918      | '-' unary_expr  {      | '-' unary_expr  {
919          $$ = new Neg($2);          if (isNumber($2->exprType())) {
920                $$ = new Neg($2);
921            } else {
922                PARSE_ERR(@2, (String("Unary '-' operator requires number, is ") + typeStr($2->exprType()) + " though.").c_str());
923                $$ = new IntLiteral({ .value = 0 });
924            }
925      }      }
926      | BITWISE_NOT unary_expr  {      | BITWISE_NOT unary_expr  {
927          if ($2->exprType() != INT_EXPR) {          if ($2->exprType() != INT_EXPR) {

Legend:
Removed from v.3815  
changed lines
  Added in v.3816

  ViewVC Help
Powered by ViewVC