From: Vern Paxson Date: Mon, 5 Apr 1993 20:35:08 +0000 (+0000) Subject: Added %array support X-Git-Tag: flex-2-5-5b~452 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e196c113e4e85ea93946ab757f71027f59904eea;p=flex Added %array support --- diff --git a/gen.c b/gen.c index 13a8e70..b1f6e98 100644 --- a/gen.c +++ b/gen.c @@ -1023,6 +1023,18 @@ void make_tables() else indent_puts( "yyleng = yy_cp - yy_bp; \\" ); + /* now also deal with copying yytext_ptr to yytext if needed */ + skelout(); + if ( yytext_is_array ) + { + indent_puts( "if ( yyleng >= YYLMAX ) \\" ); + indent_up(); + indent_puts( + "YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" ); + indent_down(); + indent_puts( "strcpy( yytext, (char *) yytext_ptr ); \\" ); + } + set_indent( 0 ); skelout();