357 |
PARSE_ERR(@3, (String("Argument ") + ToString(i+1) + " of built-in function '" + name + "' expects " + typeStr(fn->argType(i)) + " type, but type " + typeStr(args->arg(i)->exprType()) + " was given instead.").c_str()); |
PARSE_ERR(@3, (String("Argument ") + ToString(i+1) + " of built-in function '" + name + "' expects " + typeStr(fn->argType(i)) + " type, but type " + typeStr(args->arg(i)->exprType()) + " was given instead.").c_str()); |
358 |
argsOK = false; |
argsOK = false; |
359 |
break; |
break; |
360 |
|
} else if (fn->modifiesArg(i) && !args->arg(i)->isModifyable()) { |
361 |
|
PARSE_ERR(@3, (String("Argument ") + ToString(i+1) + " of built-in function '" + name + "' expects an assignable variable.").c_str()); |
362 |
|
argsOK = false; |
363 |
|
break; |
364 |
} |
} |
365 |
} |
} |
366 |
$$ = new FunctionCall(name, args, argsOK ? fn : NULL); |
$$ = new FunctionCall(name, args, argsOK ? fn : NULL); |
419 |
PARSE_ERR(@1, (String("Variable assignment: No variable declared with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("Variable assignment: No variable declared with name '") + name + "'.").c_str()); |
420 |
else if (var->isConstExpr()) |
else if (var->isConstExpr()) |
421 |
PARSE_ERR(@2, (String("Variable assignment: Cannot modify const variable '") + name + "'.").c_str()); |
PARSE_ERR(@2, (String("Variable assignment: Cannot modify const variable '") + name + "'.").c_str()); |
422 |
|
else if (!var->isAssignable()) |
423 |
|
PARSE_ERR(@2, (String("Variable assignment: Variable '") + name + "' is not assignable.").c_str()); |
424 |
else if (var->exprType() != $3->exprType()) |
else if (var->exprType() != $3->exprType()) |
425 |
PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' is of type " + typeStr(var->exprType()) + ", assignment is of type " + typeStr($3->exprType()) + " though.").c_str()); |
PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' is of type " + typeStr(var->exprType()) + ", assignment is of type " + typeStr($3->exprType()) + " though.").c_str()); |
426 |
$$ = new Assignment(var, $3); |
$$ = new Assignment(var, $3); |