2011-10-04 23:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* tests/testpre.prg
    ! updated for Harbour 3.1.x
      Patch by Alexey Myronenko
This commit is contained in:
Viktor Szakats
2011-10-04 21:52:52 +00:00
parent 641b6b4855
commit 373a56828b
2 changed files with 18 additions and 13 deletions

View File

@@ -16,6 +16,11 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-10-04 23:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* tests/testpre.prg
! updated for Harbour 3.1.x
Patch by Alexey Myronenko
2011-10-01 19:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* ChangeLog
* marked two patches merged with 3.0 branch

View File

@@ -2,40 +2,44 @@
* $Id$
*/
REQUEST __PP_STDRULES
FUNCTION Main()
LOCAL cString
LOCAL cString, l_pp
LOCAL i, j, aScript
CLS
l_pp := __pp_init()
QOut( "Testing Harbour run-time preprocessing" )
QOut( "======================================" )
QOut( "" )
cString := "@ 10, 10 SAY 'Hello!'"
QOut( cString )
QOut( __Preprocess( cString ) )
QOut( __pp_process( l_pp, cString ) )
QOut( "" )
cString := "? 'Hello mom'"
QOut( cString )
QOut( __Preprocess( cString ) )
QOut( __pp_process( l_pp, cString ) )
QOut( "" )
cString := 'SET RELATION TO Something INTO MySelf'
QOut( cString )
QOut( __Preprocess( cString ) )
QOut( __pp_process( l_pp, cString ) )
QOut( "" )
cString := 'SET RELATION ADDITIVE TO Something INTO YourSelf'
QOut( cString )
QOut( __Preprocess( cString ) )
QOut( __pp_process( l_pp, cString ) )
QOut( "" )
cString := "#xcommand DEFAULT <v1> := <x1> => IF <v1> == NIL ; <v1> := <x1> ; END"
QOut( cString )
IF __ppAddRule( cString )
IF __pp_addRule( l_pp, cString )
QOut( "Rule added successfully !" )
ELSE
QOut( "Rule addition failed ..." )
@@ -43,7 +47,7 @@ FUNCTION Main()
cString := 'DEFAULT x := 100'
QOut( cString )
QOut( __Preprocess( cString ) )
QOut( __pp_process( l_pp, cString ) )
QOut( "" )
QOut( "Press <Enter>..." )
@@ -62,12 +66,12 @@ FUNCTION Main()
'CLOSE ALL' }
FOR j := 1 TO 2
QOut( iif( j = 1, "Before", "After" ) + " __Preprocess()" )
QOut( iif( j = 1, "Before", "After" ) + " __pp_process()" )
QOut( "===================" )
QOut( "" )
FOR i := 1 TO Len( aScript )
? iif( j = 1, aScript[ i ], __Preprocess( aScript[ i ] ) )
? iif( j = 1, aScript[ i ], __pp_process( l_pp, aScript[ i ] ) )
NEXT
QOut( "" )
@@ -77,7 +81,3 @@ FUNCTION Main()
NEXT
RETURN NIL
EXIT PROCEDURE ExitTest()
__PP_Free()
RETURN