]> granicus.if.org Git - flex/commitdiff
Corrected error in manual regarding return type for yy_scan_{string,buffer,bytes}.
authorJohn Millaway <john43@users.sourceforge.net>
Fri, 5 Apr 2002 19:18:26 +0000 (19:18 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Fri, 5 Apr 2002 19:18:26 +0000 (19:18 +0000)
flex.texi

index 52a56899768ce6a588eed9d3f0512d5910902249..9d8faf0d3ec675c8a0251c81991402b20c2a4416 100644 (file)
--- a/flex.texi
+++ b/flex.texi
@@ -1877,11 +1877,11 @@ input buffer for scanning the string, and return a corresponding
 new buffer using @code{yy_switch_to_buffer()}, so the next call to
 @code{yylex()} will start scanning the string.
 
-@deftypefun void yy_scan_string ( const char *str )
+@deftypefun YY_BUFFER_STATE yy_scan_string ( const char *str )
 scans a NUL-terminated string.
 @end deftypefun
 
-@deftypefun void yy_scan_bytes ( const char *bytes, int len )
+@deftypefun YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len )
 scans @code{len} bytes (including possibly @code{NUL}s) starting at location
 @code{bytes}.
 @end deftypefun
@@ -1892,7 +1892,7 @@ the contents of the buffer it is scanning.)  You can avoid the copy by
 using:
 
 @vindex YY_END_OF_BUFFER_CHAR
-@deftypefun void yy_scan_buffer (char *base, yy_size_t size)
+@deftypefun YY_BUFFER_STATE yy_scan_buffer (char *base, yy_size_t size)
 which scans in place the buffer starting at @code{base}, consisting of
 @code{size} bytes, the last two bytes of which @emph{must} be
 @code{YY_END_OF_BUFFER_CHAR} (ASCII NUL).  These last two bytes are not
@@ -3353,12 +3353,15 @@ another instance of itself.
     %%
     "eval(".+")"  {  
                       yyscan_t scanner;
+                      YY_BUFFER_STATE buf;
+
                       yylex_init( &scanner );
                       yytext[yyleng-1] = ' '; 
 
-                      yyscan_string( yytext + 5, scanner );
+                      buf = yy_scan_string( yytext + 5, scanner );
                       yylex( scanner );
 
+                      yy_delete_buffer(buf,scanner);
                       yylex_destroy( scanner );
                  }
     ...