* after version 2.5.33
-* added new unit test for c++ and yywrap
+** memory leaks removed from the C++ scanner (but the C++ scanner is
+still experimental and may change radically without notice)
+
+** added new unit test for c++ and yywrap
** portability fixes to some unit tests
]])
}
-yyFlexLexer::~yyFlexLexer()
-{
- delete [] yy_state_buf;
- yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );
- yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
-}
-
void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
{
if ( new_in )
%endif
-%if-c-only SNIP! this currently causes conflicts with the c++ scanner
+%if-c-or-c++
+%if-c-only
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy YYFARGS0(void)
+%endif
+%if-c++-only
+yyFlexLexer::~yyFlexLexer()
+%endif
{
M4_YY_DECL_GUTS_VAR();
yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);
YY_G(yy_buffer_stack) = NULL;
+%if-c++-only
+ delete [] YY_G(yy_state_buf);
+ yyfree(YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
+%endif
+
+%if-c-only
m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
[[
/* Destroy the start condition stack. */
yyscanner = NULL;
%endif
return 0;
+%endif
}
%endif