[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: skelout patch
From: |
John W. Millaway |
Subject: |
Re: skelout patch |
Date: |
Fri, 10 May 2002 09:58:30 -0700 (PDT) |
> /* print the control line as a comment. */
> if (buf[1] != '#')
> {
> - if (buf[strlen(buf)-1]=='\\')
> out_str("/* %s */\\\n", buf);
> else
> out_str("/* %s */\n", buf);
>
The orginal code (before the patch) is correct. It handles the following
special case in flex.skl (lines 377-373) in which flex preprocessing is
performed on a multi-line C macro:
#define YY_DO_BEFORE_ACTION \
YY_G(yytext_ptr) = yy_bp; \
%% [2.0] code to fiddle yytext and yyleng for yymore() goes here \
YY_G(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
%% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \
YY_G(yy_c_buf_p) = yy_cp;
If I hadn't handled that special case by placing a trailing '\' character at
the end, then the resulting C macro would be interrupted by a comment. What
errors are you getting?
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com