20000515-19:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>

* source/compiler/harbour.l
    ! Corrected (again) rules for OPTIONAL to not conflict with DO OPTIONAL WITH ... and FOR Counter := OPTIONAL TO ...
This commit is contained in:
Ron Pinkas
2000-05-16 02:48:54 +00:00
parent f40b4c1306
commit b8f0090858
2 changed files with 67 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
20000515-19:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
! Corrected (again) rules for OPTIONAL to not conflict with DO OPTIONAL WITH ... and FOR Counter := OPTIONAL TO ...
20000515-20:22 GMT+4 April White <awhite@user.rose.com>
* source\rtl\makefile
@@ -46,10 +51,10 @@
20000515-18:00 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.c
- Removed: warning of unitialized static variable.
- Removed: warning of uninitialized static variable.
* source/compiler/hbpcode.c
- Removed: warning of unitialized static variable.
- Removed: warning of uninitialized static variable.
! Minor correction to hb_compStrongType()
20000515-23:11 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

View File

@@ -406,34 +406,85 @@ Separator {SpaceTab}
unput( yytext[ yyleng-1 ] );
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
hb_comp_iState = IDENTIFIER;
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}
"opti"("onal"|"ona"|"on"|"o")? { BEGIN OPTIONAL_;
yylval.string = hb_strupr( hb_strdup( yytext ) );
}
<OPTIONAL_>{Separator}+"with"{Separator}+[^ .] { /* DO OPTIONAL WITH ...*/
/* Push back the last character. */
unput( yytext[ --yyleng ] );
/* Remove possible white space trailing the "with". */
while( yytext[ yyleng - 1 ] < 48 )
yyleng--;
unput( ' ' );
/* Push back the "with". */
unput( 'h' );
unput( 't' );
unput( 'i' );
unput( 'w' );
yyleng -= 4;
yytext[ yyleng ] = 0;
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}
<OPTIONAL_>{Separator}+"to"{Separator}+[^ .] { /* FOR nVar := OPTIONAL TO ...*/
/* Push back the last character. */
unput( yytext[ --yyleng ] );
/* Remove possible white space trailing the "to". */
while( yytext[ yyleng - 1 ] < 48 )
yyleng--;
unput( ' ' );
/* Push back the "to". */
unput( 'o' );
unput( 't' );
yyleng -= 2;
yytext[ yyleng ] = 0;
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}
<OPTIONAL_>{Separator}+[_a-zA-Z\&] { /* an Identifier after OPTIONAL */
unput( yytext[ yyleng-1 ] );
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
/* OPTIONAL as first item on a line can't be a qualifier. */
if( hb_comp_iState == LOOKUP )
{ /* it is first item in the line */
hb_xfree( (void *) yylval.string );
hb_comp_iState = OPTIONAL;
return OPTIONAL;
}
else
{ /* there is another item in line already */
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}
else
{ /* Now it should be a qalifier. */
hb_xfree( (void *) yylval.string );
hb_comp_iState = OPTIONAL;
return OPTIONAL;
}
}
<OPTIONAL_>{Separator}*[^a-zA-Z] { /* any character (not identifier) after OPTIONAL */
unput( yytext[ yyleng-1 ] );
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
hb_comp_iState = IDENTIFIER;
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}