parse.c (flex-2.6.3) | : | parse.c (flex-2.6.4) | ||
---|---|---|---|---|
skipping to change at line 112 | skipping to change at line 112 | |||
int scon_stk_ptr; | int scon_stk_ptr; | |||
static int madeany = false; /* whether we've made the '.' character class */ | static int madeany = false; /* whether we've made the '.' character class */ | |||
static int ccldot, cclany; | static int ccldot, cclany; | |||
int previous_continued_action; /* whether the previous rule's action was '|' */ | int previous_continued_action; /* whether the previous rule's action was '|' */ | |||
#define format_warn3(fmt, a1, a2) \ | #define format_warn3(fmt, a1, a2) \ | |||
do{ \ | do{ \ | |||
char fw3_msg[MAXLINE];\ | char fw3_msg[MAXLINE];\ | |||
snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ | snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ | |||
warn( fw3_msg );\ | lwarn( fw3_msg );\ | |||
}while(0) | }while(0) | |||
/* Expand a POSIX character class expression. */ | /* Expand a POSIX character class expression. */ | |||
#define CCL_EXPR(func) \ | #define CCL_EXPR(func) \ | |||
do{ \ | do{ \ | |||
int c; \ | int c; \ | |||
for ( c = 0; c < csize; ++c ) \ | for ( c = 0; c < csize; ++c ) \ | |||
if ( isascii(c) && func(c) ) \ | if ( isascii(c) && func(c) ) \ | |||
ccladd( currccl, c ); \ | ccladd( currccl, c ); \ | |||
}while(0) | }while(0) | |||
skipping to change at line 1696 | skipping to change at line 1696 | |||
else | else | |||
{ | { | |||
/* This EOF applies to all start conditions | /* This EOF applies to all start conditions | |||
* which don't already have EOF actions. | * which don't already have EOF actions. | |||
*/ | */ | |||
for ( i = 1; i <= lastsc; ++i ) | for ( i = 1; i <= lastsc; ++i ) | |||
if ( ! sceof[i] ) | if ( ! sceof[i] ) | |||
scon_stk[++scon_stk_ptr] = i; | scon_stk[++scon_stk_ptr] = i; | |||
if ( scon_stk_ptr == 0 ) | if ( scon_stk_ptr == 0 ) | |||
warn( | lwarn( | |||
"all start conditions already have <<EOF>> rules" ); | "all start conditions already have <<EOF>> rules" ); | |||
else | else | |||
build_eof_action(); | build_eof_action(); | |||
} | } | |||
} | } | |||
#line 1728 "parse.c" /* yacc.c:1646 */ | #line 1728 "parse.c" /* yacc.c:1646 */ | |||
break; | break; | |||
case 30: | case 30: | |||
skipping to change at line 1806 | skipping to change at line 1806 | |||
{ | { | |||
/* We need to treat this as variable trailing | /* We need to treat this as variable trailing | |||
* context so that the backup does not happen | * context so that the backup does not happen | |||
* in the action but before the action switch | * in the action but before the action switch | |||
* statement. If the backup happens in the | * statement. If the backup happens in the | |||
* action, then the rules "falling into" this | * action, then the rules "falling into" this | |||
* one's action will *also* do the backup, | * one's action will *also* do the backup, | |||
* erroneously. | * erroneously. | |||
*/ | */ | |||
if ( ! varlength || headcnt != 0 ) | if ( ! varlength || headcnt != 0 ) | |||
warn( | lwarn( | |||
"trailing context made variable due to preceding '|' action" ); | "trailing context made variable due to preceding '|' action" ); | |||
/* Mark as variable. */ | /* Mark as variable. */ | |||
varlength = true; | varlength = true; | |||
headcnt = 0; | headcnt = 0; | |||
} | } | |||
if ( lex_compat || (varlength && headcnt == 0) ) | if ( lex_compat || (varlength && headcnt == 0) ) | |||
{ /* variable trailing context rule */ | { /* variable trailing context rule */ | |||
skipping to change at line 1867 | skipping to change at line 1867 | |||
{ | { | |||
synerr( _("trailing context used twice") ); | synerr( _("trailing context used twice") ); | |||
(yyval) = mkstate( SYM_EPSILON ); | (yyval) = mkstate( SYM_EPSILON ); | |||
} | } | |||
else if ( previous_continued_action ) | else if ( previous_continued_action ) | |||
{ | { | |||
/* See the comment in the rule for "re2 re" | /* See the comment in the rule for "re2 re" | |||
* above. | * above. | |||
*/ | */ | |||
warn( | lwarn( | |||
"trailing context made variable due to preceding '|' action" ); | "trailing context made variable due to preceding '|' action" ); | |||
varlength = true; | varlength = true; | |||
} | } | |||
if ( lex_compat || varlength ) | if ( lex_compat || varlength ) | |||
{ | { | |||
/* Again, see the comment in the rule for | /* Again, see the comment in the rule for | |||
* "re2 re" above. | * "re2 re" above. | |||
*/ | */ | |||
skipping to change at line 2516 | skipping to change at line 2516 | |||
case 93: | case 93: | |||
#line 915 "parse.y" /* yacc.c:1646 */ | #line 915 "parse.y" /* yacc.c:1646 */ | |||
{ CCL_NEG_EXPR(isxdigit); } | { CCL_NEG_EXPR(isxdigit); } | |||
#line 2534 "parse.c" /* yacc.c:1646 */ | #line 2534 "parse.c" /* yacc.c:1646 */ | |||
break; | break; | |||
case 94: | case 94: | |||
#line 916 "parse.y" /* yacc.c:1646 */ | #line 916 "parse.y" /* yacc.c:1646 */ | |||
{ | { | |||
if ( sf_case_ins() ) | if ( sf_case_ins() ) | |||
warn(_("[:^lower:] is ambiguous in case i nsensitive scanner")); | lwarn(_("[:^lower:] is ambiguous in case insensitive scanner")); | |||
else | else | |||
CCL_NEG_EXPR(islower); | CCL_NEG_EXPR(islower); | |||
} | } | |||
#line 2545 "parse.c" /* yacc.c:1646 */ | #line 2545 "parse.c" /* yacc.c:1646 */ | |||
break; | break; | |||
case 95: | case 95: | |||
#line 922 "parse.y" /* yacc.c:1646 */ | #line 922 "parse.y" /* yacc.c:1646 */ | |||
{ | { | |||
if ( sf_case_ins() ) | if ( sf_case_ins() ) | |||
warn(_("[:^upper:] ambiguous in case inse nsitive scanner")); | lwarn(_("[:^upper:] ambiguous in case ins ensitive scanner")); | |||
else | else | |||
CCL_NEG_EXPR(isupper); | CCL_NEG_EXPR(isupper); | |||
} | } | |||
#line 2556 "parse.c" /* yacc.c:1646 */ | #line 2556 "parse.c" /* yacc.c:1646 */ | |||
break; | break; | |||
case 96: | case 96: | |||
#line 931 "parse.y" /* yacc.c:1646 */ | #line 931 "parse.y" /* yacc.c:1646 */ | |||
{ | { | |||
if ( (yyvsp[0]) == nlch ) | if ( (yyvsp[0]) == nlch ) | |||
skipping to change at line 2846 | skipping to change at line 2846 | |||
pinpoint_message( str ); | pinpoint_message( str ); | |||
} | } | |||
/* format_warn - write out formatted warning */ | /* format_warn - write out formatted warning */ | |||
void format_warn( const char *msg, const char arg[] ) | void format_warn( const char *msg, const char arg[] ) | |||
{ | { | |||
char warn_msg[MAXLINE]; | char warn_msg[MAXLINE]; | |||
snprintf( warn_msg, sizeof(warn_msg), msg, arg ); | snprintf( warn_msg, sizeof(warn_msg), msg, arg ); | |||
warn( warn_msg ); | lwarn( warn_msg ); | |||
} | } | |||
/* warn - report a warning, unless -w was given */ | /* lwarn - report a warning, unless -w was given */ | |||
void warn( const char *str ) | void lwarn( const char *str ) | |||
{ | { | |||
line_warning( str, linenum ); | line_warning( str, linenum ); | |||
} | } | |||
/* format_pinpoint_message - write out a message formatted with one string, | /* format_pinpoint_message - write out a message formatted with one string, | |||
* pinpointing its location | * pinpointing its location | |||
*/ | */ | |||
void format_pinpoint_message( const char *msg, const char arg[] ) | void format_pinpoint_message( const char *msg, const char arg[] ) | |||
{ | { | |||
End of changes. 9 change blocks. | ||||
9 lines changed or deleted | 9 lines changed or added |