diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3bc243d88c..a8fd3b2dec 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +20000508-00:20 GMT-8 Ron Pinkas + + * source/compiler/harbour.l + + Added rules so that "optional" won't conflict with identifiers named optional. + 20000507-21:20 GMT-8 Ron Pinkas * source/compiler/harbour.l diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index e0d49e1485..88a74b9fd6 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -113,6 +113,7 @@ Separator {SpaceTab} %x FOR_ FUNCTION_ IIF_ IF_ IN_ INIT_ LOCAL_ LOOP_ DECLARE_ %x MEMVAR_ PARAM_ PRIVATE_ PUBLIC_ STATIC_ RETURN_ RECOVER_ %x INVALIDNUM_ OTHERWISE_ PROCEDURE_ +%x OPTIONAL_ %s INDEX %% @@ -356,6 +357,16 @@ Separator {SpaceTab} %{ /* ************************************************************************ */ %} +"optional" { BEGIN OPTIONAL_; } +{Separator}+[_a-zA-Z\&] { unput( yytext[ yyleng-1 ] ); BEGIN 0; return OPTIONAL; } +{Separator}*(.|\n) { /* end of line or any operator */ + if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0; + unput( yytext[ yyleng-1 ] ); + yylval.string = hb_strdup( "OPTIONAL" ); + hb_comp_iState = IDENTIFIER; + return IDENTIFIER; + } + "do" BEGIN DO_; {Separator}+"case" { /* DO CASE statement */ if( i_INDEX_STATE ) BEGIN INDEX; else BEGIN 0; @@ -1328,7 +1339,6 @@ Separator {SpaceTab} "as variant array" { return AS_VARIANT; } "declare function" { return DECLARE_FUN; } -"optional" { return OPTIONAL;} %{ /* ************************************************************************ */