diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index 229200633a..5259869db7 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -1539,7 +1539,7 @@ int yy_lex_input( char *buffer, int iBufferSize ) { HB_SYMBOL_UNUSED( iBufferSize ); - return hb_pp_Internal( yyin, hb_comp_bPPO ? hb_comp_yyppo : NULL, buffer ); + return hb_pp_Internal( hb_comp_bPPO ? hb_comp_yyppo : NULL, buffer ); } static int yy_ConvertNumber( char * szBuffer ) diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index c2b08640fd..2eb006a87e 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -125,6 +125,8 @@ USHORT hb_comp_wIfCounter = 0; USHORT hb_comp_wWhileCounter = 0; USHORT hb_comp_wCaseCounter = 0; +char *hb_comp_buffer; /* yacc input buffer */ + static PTR_LOOPEXIT hb_comp_pLoops = NULL; static HB_RTVAR_PTR hb_comp_rtvars = NULL; @@ -1523,6 +1525,7 @@ BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearch ) pFile->szFileName = szFileName; pFile->pPrev = NULL; +/* if( ! hb_comp_files.iFiles ) hb_comp_files.pLast = pFile; else @@ -1536,6 +1539,14 @@ BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearch ) yy_switch_to_buffer( ( YY_BUFFER_STATE ) ( pFile->pBuffer = yy_create_buffer( yyin, 8192 * 2 ) ) ); #else yy_switch_to_buffer( pFile->pBuffer = yy_create_buffer( yyin, 8192 * 2 ) ); +#endif +*/ + + hb_comp_files.pLast = pFile; +#ifdef __cplusplus + yy_switch_to_buffer( ( YY_BUFFER_STATE ) ( hb_comp_buffer = yy_create_buffer( yyin, 8192 * 2 ) ) ); +#else + yy_switch_to_buffer( hb_comp_buffer = yy_create_buffer( yyin, 8192 * 2 ) ); #endif hb_comp_files.iFiles++; @@ -1548,6 +1559,7 @@ int yywrap( void ) /* handles the EOF of the currently processed file */ if( hb_comp_files.iFiles == 1 ) return 1; /* we have reached the main EOF */ +/* else { pLast = hb_comp_files.pLast; @@ -1567,8 +1579,9 @@ int yywrap( void ) /* handles the EOF of the currently processed file */ #else yy_switch_to_buffer( hb_comp_files.pLast->pBuffer ); #endif - return 0; /* we close the currently include file and continue */ + return 0; } +*/ /* we close the currently include file and continue */ } /* ************************************************************************* */