💎💎💎💎💎
This commit is contained in:
@ -306,7 +306,9 @@ function_declaration:
|
||||
if(getAdInfoType(table_lookup(cur, $4))==TYPE_FUNCTION_TYPE){
|
||||
//printf("%s\n",$2);
|
||||
//printf("%s\n",getName(table_lookup(cur, $4)));
|
||||
CreateEntry(cur,TYPE_FUNCTION_DECLARATION, table_lookup(cur, $4), $2, CreateFunctionDeclarationInfo(-1, false,NULL));
|
||||
if (CreateEntry(cur,TYPE_FUNCTION_DECLARATION, table_lookup(cur, $4), $2, CreateFunctionDeclarationInfo(-1, false,NULL)) == undefined) {
|
||||
throw_error(ERROR_TYPE, "Duplicate defination of function in function declaration");
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw_error(ERROR_TYPE, "Function declatation (%s) is not a valid function type", $2);
|
||||
@ -318,7 +320,9 @@ function_declaration:
|
||||
| EXTERNAL FUNCTION ID COLON ID
|
||||
{
|
||||
if(getAdInfoType(look_up(cur, $5))==TYPE_FUNCTION_TYPE){
|
||||
CreateEntry(cur,TYPE_FUNCTION_DECLARATION, look_up(cur, $5), $3, CreateFunctionDeclarationInfo(-1, false,NULL));
|
||||
if (CreateEntry(cur,TYPE_FUNCTION_DECLARATION, look_up(cur, $5), $3, CreateFunctionDeclarationInfo(-1, false,NULL)) == undefined) {
|
||||
throw_error(ERROR_TYPE, "Duplicate defination of function in function declaration");
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw_error(ERROR_TYPE, "Function declatation (%s) is not a valid function type", $3);
|
||||
@ -1579,7 +1583,7 @@ void throw_error(ErrorType error_type, const char *format, ...) {
|
||||
}
|
||||
|
||||
if (asc_flag) {
|
||||
/* yyerror(""); */
|
||||
yyerror("");
|
||||
int needed = snprintf(NULL, 0, " LINE (%d:%d) ** %s ERROR: ", line, column, error_name);
|
||||
char *error_message = malloc(needed + 1);
|
||||
snprintf(error_message, needed + 1, " LINE (%d:%d) ** %s ERROR: ", line, column, error_name);
|
||||
|
Reference in New Issue
Block a user