20000514-10:07 GMT-8 Ron Pinkas <Ron@Profit-Master.com>

* source/compiler/harbour.l
    ! Fixed parse error when DO OPTIONAL WITH 1 or " or other non alpha charcaters
    ! Fixed parse error when FOR Var := OPTIONAL TO ...
This commit is contained in:
Ron Pinkas
2000-05-14 17:07:30 +00:00
parent f336ac266e
commit 7943176b91
3 changed files with 21 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
20000514-10:07 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
! Fixed parse error when DO OPTIONAL WITH 1 or " or other non alpha charcaters
! Fixed parse error when FOR Var := OPTIONAL TO ...
20000514-09:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.y

View File

@@ -360,7 +360,7 @@ Separator {SpaceTab}
<INITIAL>"optional" { BEGIN OPTIONAL_; }
<OPTIONAL_>{Separator}+"with"{Separator}+[_a-zA-Z\&] { unput( yytext[ yyleng-1 ] );
<OPTIONAL_>{Separator}+"with"{Separator}+[^ .] { unput( yytext[ yyleng-1 ] );
unput( ' ' );
unput( 'h' );
unput( 't' );
@@ -372,6 +372,16 @@ Separator {SpaceTab}
return IDENTIFIER;
}
<OPTIONAL_>{Separator}+"to"{Separator}+[^ .] { unput( yytext[ yyleng-1 ] );
unput( ' ' );
unput( 'o' );
unput( 't' );
if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0;
yylval.string = hb_strdup( "OPTIONAL" );
hb_comp_iState = IDENTIFIER;
return IDENTIFIER;
}
<OPTIONAL_>{Separator}+[_a-zA-Z\&] { unput( yytext[ yyleng-1 ] ); BEGIN 0; return OPTIONAL; }
<OPTIONAL_>{Separator}*(.|\n) { /* end of line or any operator */

View File

@@ -89,9 +89,11 @@ PROCEDURE THEMAIN( optional )
PRIVATE TEST AS CHAR
DO Optional WITH cVar
DO Proc WITH
FOR Conter := 1 TO 10
DO Optional WITH
FOR Conter := Optional TO 10
? "For with End"
End