From 8ba63746855a5d39c34f26bdbfcfb28ecfa8e8a3 Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Sat, 29 Jul 2000 14:54:10 +0000 Subject: [PATCH] 2000-07-29 07:40 UTC+0800 Ron Pinkas * source/compiler/harbour.slx + Added 2 rules to support DECLARE MACROVAR and DECLARE MACRO TEXT * tests/testdecl.prg ! Fixed to allow it to be run without RT Error --- harbour/ChangeLog | 11 +++++++++-- harbour/source/compiler/harbour.slx | 10 ++++++---- harbour/tests/testdecl.prg | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bf49aefcd0..71d5fff1bc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,8 +1,15 @@ +2000-07-29 07:40 UTC+0800 Ron Pinkas + * source/compiler/harbour.slx + + Added 2 rules to support DECLARE MACROVAR and DECLARE MACRO TEXT + + * tests/testdecl.prg + ! Fixed to allow it to be run without RT Error + 2000-07-29 15:55 UTC+0100 Ryszard Glab *source/compiler/harbour.l * fixed to properly support 'DECLARE var' statement - + *tests/Makefile *tests/testdecl.prg * added testdecl.prg to Makefile @@ -12,7 +19,7 @@ *include/hbcomp.h * removed declaration of hb_comp_iCompiled and hb_comp_EOL - + *source/compiler/harbour.c *source/compiler/harbour.l *source/compiler/harbour.y diff --git a/harbour/source/compiler/harbour.slx b/harbour/source/compiler/harbour.slx index 8d3e25a56f..b9c680add4 100644 --- a/harbour/source/compiler/harbour.slx +++ b/harbour/source/compiler/harbour.slx @@ -297,10 +297,10 @@ LANGUAGE_WORDS_ARE { #define _CASE_WITH 3005 #define _WHL_ID_CR 3006 #define _WHL_ID_SEMI 3007 -#define _INC_CR 3007 -#define _INC_SEMI 3008 -#define _DEC_CR 3008 -#define _DEC_SEMI 3009 +#define _INC_CR 3008 +#define _INC_SEMI 3009 +#define _DEC_CR 3010 +#define _DEC_SEMI 3011 LANGUAGE_RULES_ARE { IF_SEQUENCE_IS( '^' , 0 , 0 , 0 ) REDUCE_TO( POWER , 0 ), @@ -408,6 +408,8 @@ LANGUAGE_RULES_ARE { IF_SEQUENCE_IS( DECLARE , IDENTIFIER , '(' , 0 ) PASS_THROUGH(), IF_SEQUENCE_IS( DECLARE , IDENTIFIER , HB_ID_ON_HOLD, 0 ) PASS_THROUGH(), IF_SEQUENCE_IS( DECLARE , IDENTIFIER , 0 , 0 ) REDUCE_TO( PRIVATE , IDENTIFIER ), + IF_SEQUENCE_IS( DECLARE , MACROVAR , 0 , 0 ) REDUCE_TO( PRIVATE , MACROVAR ), + IF_SEQUENCE_IS( DECLARE , MACROTEXT , 0 , 0 ) REDUCE_TO( PRIVATE , MACROTEXT ), IF_SEQUENCE_IS( DECLARE , 0 , 0 , 0 ) REDUCE_TO( HB_DECLARE_ID , 0 ), IF_SEQUENCE_IS( PUBLIC , TO , 0 , 0 ) REDUCE_TO( HB_PUBLIC_ID , TO ), diff --git a/harbour/tests/testdecl.prg b/harbour/tests/testdecl.prg index 1fb142a35c..722d019992 100644 --- a/harbour/tests/testdecl.prg +++ b/harbour/tests/testdecl.prg @@ -17,7 +17,7 @@ Function Main() DECLARE Var1 DECLARE Var2 := 2 DECLARE aVar[2] - DECLARE Var3, Var4, aVar5[1] + DECLARE Var3 := 'Var9', Var4, aVar5[1] DECLARE Var6, Var7:=7, aVar8[8] DECLARE &var3 DECLARE &Var3.