From 0eaac65ea4b6432b65e407dc9ab80f084d6881ad Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Fri, 14 May 1999 11:08:20 +0000 Subject: [PATCH] Proper error generation for missing include files --- harbour/source/compiler/harbour.y | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 3981394184..15220eb52e 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -224,6 +224,7 @@ int iVarScope = 0; /* holds the scope for next variables to be defined #define ERR_STRING_TERMINATOR 7 #define ERR_FUNC_RESERVED 8 #define ERR_ILLEGAL_INIT 9 +#define ERR_CANT_OPEN_INCLUDE 10 /* Table with parse errors */ char * _szErrors[] = { "Statement not allowed outside of procedure or function", @@ -234,7 +235,8 @@ char * _szErrors[] = { "Statement not allowed outside of procedure or function", "Invalid numeric format '.'", "Unterminated string: \'%s\'", "Redefinition of predefined function %s: \'%s\'", - "Illegal initializer: \'%s\'" + "Illegal initializer: \'%s\'", + "Can't open #include file: \'%s\'" }; /* Table with reserved functions names @@ -423,7 +425,9 @@ Source : Crlf | Source MEMVAR IdentList ; -Include : NE1 INCLUDE LITERAL { Include( $3 ); } Crlf +Include : NE1 INCLUDE LITERAL { if( ! Include( $3 ) ) + GenError( ERR_CANT_OPEN_INCLUDE, $3, NULL ); + } Crlf ; Extern : EXTERN ExtList Crlf