23 |
#define scanner context->scanner |
#define scanner context->scanner |
24 |
#define PARSE_ERR(loc,txt) yyerror(&loc, context, txt) |
#define PARSE_ERR(loc,txt) yyerror(&loc, context, txt) |
25 |
#define PARSE_WRN(loc,txt) InstrScript_warning(&loc, context, txt) |
#define PARSE_WRN(loc,txt) InstrScript_warning(&loc, context, txt) |
26 |
|
#define PARSE_DROP(loc) context->addPreprocessorComment(loc.first_line, loc.last_line, loc.first_column+1, loc.last_column+1); |
27 |
#define yytnamerr(res,str) InstrScript_tnamerr(res, str) |
#define yytnamerr(res,str) InstrScript_tnamerr(res, str) |
28 |
%} |
%} |
29 |
|
|
475 |
} else if (!fn) { |
} else if (!fn) { |
476 |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
477 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |
478 |
|
} else if (context->functionProvider->isFunctionDisabled(fn,context)) { |
479 |
|
PARSE_DROP(@$); |
480 |
|
$$ = new NoFunctionCall; |
481 |
} else if (args->argsCount() < fn->minRequiredArgs()) { |
} else if (args->argsCount() < fn->minRequiredArgs()) { |
482 |
PARSE_ERR(@3, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
PARSE_ERR(@3, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
483 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |
511 |
} else if (!fn) { |
} else if (!fn) { |
512 |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
513 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |
514 |
|
} else if (context->functionProvider->isFunctionDisabled(fn,context)) { |
515 |
|
PARSE_DROP(@$); |
516 |
|
$$ = new NoFunctionCall; |
517 |
} else if (fn->minRequiredArgs() > 0) { |
} else if (fn->minRequiredArgs() > 0) { |
518 |
PARSE_ERR(@3, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
PARSE_ERR(@3, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
519 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |
532 |
} else if (!fn) { |
} else if (!fn) { |
533 |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("No built-in function with name '") + name + "'.").c_str()); |
534 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |
535 |
|
} else if (context->functionProvider->isFunctionDisabled(fn,context)) { |
536 |
|
PARSE_DROP(@$); |
537 |
|
$$ = new NoFunctionCall; |
538 |
} else if (fn->minRequiredArgs() > 0) { |
} else if (fn->minRequiredArgs() > 0) { |
539 |
PARSE_ERR(@1, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
PARSE_ERR(@1, (String("Built-in function '") + name + "' requires at least " + ToString(fn->minRequiredArgs()) + " arguments.").c_str()); |
540 |
$$ = new FunctionCall(name, args, NULL); |
$$ = new FunctionCall(name, args, NULL); |