June 1st. 1999 00:30 Ron Pinkas
Harbour.y -> modified pcode generation to move the push of the counter variable to the NEXT rather than the FOR
so loop code may manipulate the counter vaiable.
TEST/WORKING/TestFor.prg -> added this file
This commit is contained in:
@@ -1546,11 +1546,11 @@ May 31, 1999 Ron Pinkas
|
||||
Added "Sysntax error :" message for the macro operator (&)
|
||||
when followed by a string delimiter.
|
||||
|
||||
June 1st. 1999 00:30 Ron Pinkas
|
||||
Harbour.y -> modified pcode generation to move the push of the counter variable to the NEXT rather than the FOR
|
||||
so loop code may manipulate the counter vaiable.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TEST/WORKING/TestFor.prg -> added this file
|
||||
* source/pp/pragma.c
|
||||
* contrib/dot/pp_harb.ch
|
||||
* tests/inline_c.prg
|
||||
|
||||
@@ -842,7 +842,7 @@ EndCase : ENDCASE { --_wCaseCounter; }
|
||||
| END { --_wCaseCounter; }
|
||||
;
|
||||
|
||||
DoCaseBegin : DOCASE { ++_wCaseCounter; } Crlf
|
||||
DoCaseBegin : DOCASE { ++_wCaseCounter; } Crlf
|
||||
;
|
||||
|
||||
Cases : CASE Expression Crlf { $<iNumber>$ = JumpFalse( 0 ); Line(); } CaseStmts { $$ = GenElseIf( 0, Jump( 0 ) ); JumpHere( $<iNumber>4 ); Line(); }
|
||||
@@ -878,8 +878,8 @@ EndWhile : END
|
||||
|
||||
ForNext : FOR IDENTIFIER ForAssign Expression { PopId( $2 ); $<iNumber>$ = functions.pLast->lPCodePos; ++_wForCounter; }
|
||||
TO Expression { PushId( $2 ); }
|
||||
StepExpr Crlf { GenPCode1( _FORTEST ); $<iNumber>$ = JumpTrue( 0 ); PushId( $2 ); }
|
||||
ForStatements { GenPCode1( _PLUS ); PopId( $2 ); Jump( $<iNumber>5 - functions.pLast->lPCodePos ); JumpHere( $<iNumber>11 ); }
|
||||
StepExpr Crlf { GenPCode1( _FORTEST ); $<iNumber>$ = JumpTrue( 0 ); /*PushId( $2 )*/; }
|
||||
ForStatements { PushId( $2 ); GenPCode1( _PLUS ); PopId( $2 ); Jump( $<iNumber>5 - functions.pLast->lPCodePos ); JumpHere( $<iNumber>11 ); }
|
||||
;
|
||||
|
||||
ForAssign : '='
|
||||
|
||||
@@ -181,7 +181,7 @@ static procedure Commit()
|
||||
fwrite(hFile, ::Contents[i][2][j][1] + '=' +;
|
||||
::Contents[i][2][j][2] + Chr(13) + Chr(10))
|
||||
endif
|
||||
next j
|
||||
next //j
|
||||
fwrite(hFile, Chr(13) + Chr(10))
|
||||
|
||||
elseif ValType(::Contents[i][2]) == 'C'
|
||||
@@ -189,8 +189,8 @@ static procedure Commit()
|
||||
Chr(10))
|
||||
|
||||
endif
|
||||
next i
|
||||
next //i
|
||||
fclose(hFile)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
19
harbour/tests/working/testfor.prg
Normal file
19
harbour/tests/working/testfor.prg
Normal file
@@ -0,0 +1,19 @@
|
||||
FUNCTION MAIN
|
||||
|
||||
LOCAL i
|
||||
|
||||
FOR i := 1 TO 10
|
||||
|
||||
qout( i )
|
||||
|
||||
IF i = 4
|
||||
__Accept("")
|
||||
qout(i)
|
||||
i := 9
|
||||
qout(i)
|
||||
__Accept("")
|
||||
ENDIF
|
||||
|
||||
NEXT
|
||||
|
||||
RETURN( NIL )
|
||||
Reference in New Issue
Block a user