diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 76b927b9aa..32732d4721 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,7 +1,19 @@ +20000520-10:07 GMT-8 Ron Pinkas + + * source/compiler/harbour.l + - Removed rule for "FROM CLASS" + + Added "AS Obj" as an abrreviation for "AS Object" + + * source/compiler/harbour.y + * Changed "AS Object FROM CLASS ClassName" to "As Object ClassName" + + * tests/testwarn.prg + * Modified code to demonstrate new syntax for "As Object..." + 20000520-15:25 GMT+1 Ryszard Glab *source/rtl/gtcrs/gtcrs.c - * fixed hb_gt_SetAttribute() to work correctly + * fixed hb_gt_SetAttribute() to work correctly with ncurses library (thanks to Marek Paliwoda) @@ -10,11 +22,11 @@ *source/rtl/gtcrs/gtcrs.c * fixed hb_gt_SetAttribute() to work with plain curses library (thanks to Marek Paliwoda) - + *source/rtl/gtcrs/kbdcrs.c *source/rtl/gtcrs/mousecrs.c * fixed a module description - + 20000519-23:50 GMT-3 Luiz Rafael Culik *makefile.bc makefile.vc diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index 648ec6ba19..0c14bcc296 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -1444,6 +1444,7 @@ Separator {SpaceTab} "as boolean" { return AS_LOGICAL; } "as num" { return AS_NUMERIC; } "as numeric" { return AS_NUMERIC; } +"as obj" { return AS_OBJECT; } "as object" { return AS_OBJECT; } "as var" { return AS_VARIANT; } "as variant" { return AS_VARIANT; } @@ -1461,10 +1462,9 @@ Separator {SpaceTab} "as array of boolean" { return AS_LOGICAL_ARRAY; } "as array of num" { return AS_NUMERIC_ARRAY; } "as array of numeric" { return AS_NUMERIC_ARRAY; } +"as array of obj" { return AS_OBJECT_ARRAY; } "as array of object" { return AS_OBJECT_ARRAY; } -"from class" { return FROMCLASS; } - %{ /* ************************************************************************ */ %} diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 8ca8a921d7..14ec05064d 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -163,7 +163,6 @@ char * hb_comp_szAnnounce = NULL; /* ANNOUNCEd procedure */ %token MACROVAR MACROTEXT %token AS_ARRAY AS_BLOCK AS_CHARACTER AS_DATE AS_LOGICAL AS_NUMERIC AS_OBJECT AS_VARIANT DECLARE OPTIONAL %token AS_ARRAY_ARRAY AS_BLOCK_ARRAY AS_CHARACTER_ARRAY AS_DATE_ARRAY AS_LOGICAL_ARRAY AS_NUMERIC_ARRAY AS_OBJECT_ARRAY -%token FROMCLASS /*the lowest precedence*/ /*postincrement and postdecrement*/ @@ -277,24 +276,24 @@ Params : { $$ = 0; } | '(' { hb_comp_iVarScope = VS_PARAMETER; } ParamList ')' { $$ = $3; } ; -AsType : /* not specified */ { hb_comp_cVarType = ' '; } - | AS_NUMERIC { hb_comp_cVarType = 'N'; } - | AS_CHARACTER { hb_comp_cVarType = 'C'; } - | AS_DATE { hb_comp_cVarType = 'D'; } - | AS_LOGICAL { hb_comp_cVarType = 'L'; } - | AS_ARRAY { hb_comp_cVarType = 'A'; } - | AS_BLOCK { hb_comp_cVarType = 'B'; } - | AS_OBJECT { hb_comp_cVarType = 'O'; } - | AS_OBJECT FROMCLASS IdentName { hb_comp_cVarType = 'S'; hb_comp_szFromClass = $3 } - | AS_VARIANT { hb_comp_cVarType = ' '; } - | AS_NUMERIC_ARRAY { hb_comp_cVarType = 'n'; } - | AS_CHARACTER_ARRAY { hb_comp_cVarType = 'c'; } - | AS_DATE_ARRAY { hb_comp_cVarType = 'd'; } - | AS_LOGICAL_ARRAY { hb_comp_cVarType = 'l'; } - | AS_ARRAY_ARRAY { hb_comp_cVarType = 'a'; } - | AS_BLOCK_ARRAY { hb_comp_cVarType = 'b'; } - | AS_OBJECT_ARRAY { hb_comp_cVarType = 'o'; } - | AS_OBJECT_ARRAY FROMCLASS IdentName { hb_comp_cVarType = 's'; hb_comp_szFromClass = $3 } +AsType : /* not specified */ { hb_comp_cVarType = ' '; } + | AS_NUMERIC { hb_comp_cVarType = 'N'; } + | AS_CHARACTER { hb_comp_cVarType = 'C'; } + | AS_DATE { hb_comp_cVarType = 'D'; } + | AS_LOGICAL { hb_comp_cVarType = 'L'; } + | AS_ARRAY { hb_comp_cVarType = 'A'; } + | AS_BLOCK { hb_comp_cVarType = 'B'; } + | AS_OBJECT { hb_comp_cVarType = 'O'; } + | AS_OBJECT IdentName { hb_comp_cVarType = 'S'; hb_comp_szFromClass = $2 } + | AS_VARIANT { hb_comp_cVarType = ' '; } + | AS_NUMERIC_ARRAY { hb_comp_cVarType = 'n'; } + | AS_CHARACTER_ARRAY { hb_comp_cVarType = 'c'; } + | AS_DATE_ARRAY { hb_comp_cVarType = 'd'; } + | AS_LOGICAL_ARRAY { hb_comp_cVarType = 'l'; } + | AS_ARRAY_ARRAY { hb_comp_cVarType = 'a'; } + | AS_BLOCK_ARRAY { hb_comp_cVarType = 'b'; } + | AS_OBJECT_ARRAY { hb_comp_cVarType = 'o'; } + | AS_OBJECT_ARRAY IdentName { hb_comp_cVarType = 's'; hb_comp_szFromClass = $2 } ; AsArray : AS_ARRAY { hb_comp_cVarType = 'A'; }