From 538fee3ae7eb505b7ef3ba79e36c43c6d6720bbf Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Fri, 20 Oct 2000 06:16:41 +0000 Subject: [PATCH] 2000-10-19 23:15 UTC+0800 Ron Pinkas * contrib/dot/pp.prg * Minor corrections. --- harbour/ChangeLog | 4 +++ harbour/contrib/dot/pp.prg | 51 +++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7ef0f0213b..de277e50f0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2000-10-19 23:15 UTC+0800 Ron Pinkas + * contrib/dot/pp.prg + * Minor corrections. + 2000-10-19 22:00 UTC+0800 Ron Pinkas * contrib/dot/pp.prg ! Fixed checking of stoppers for #XCOMMAND/#XTRANSLATE diff --git a/harbour/contrib/dot/pp.prg b/harbour/contrib/dot/pp.prg index dfc73fbe96..b38186b219 100644 --- a/harbour/contrib/dot/pp.prg +++ b/harbour/contrib/dot/pp.prg @@ -1740,11 +1740,7 @@ FUNCTION NextToken( sLine, bCheckRules ) //? "Called from: " + ProcName(1) + " Line: " + Str( ProcLine(1) ) + " Scaning: " + sLine - IF Left( sLine, 1 ) == '|' - - sReturn := Left( sLine, 1 ) - - ELSEIF sLeft2Chars == "==" + IF sLeft2Chars == "==" sReturn := sLeft2Chars @@ -1832,7 +1828,7 @@ FUNCTION NextToken( sLine, bCheckRules ) nClose := AT( "'", SubStr( sLine, 2 ) ) IF nClose == 0 - Alert( "ERROR! [NextExp()] Unterminated ['] at: " + sLine ) + Alert( "ERROR! [NextToken()] Unterminated ['] at: " + sLine ) RETURN NIL ELSE sReturn := SubStr( sLine, 2, nClose - 1 ) @@ -1873,7 +1869,7 @@ FUNCTION NextToken( sLine, bCheckRules ) ENDIF - ELSEIF Left( sLine, 1 ) $ "?+-*/:=^!&()[]&{}@," + ELSEIF Left( sLine, 1 ) $ "?+-*/:=^!&()[]&{}@,|" sReturn := Left( sLine, 1 ) @@ -1936,9 +1932,9 @@ FUNCTION NextToken( sLine, bCheckRules ) ENDIF IF ( sReturn == NIL ) -//? "TOKEN = 'NIL' AT: ", sLine + //? "TOKEN = 'NIL' AT: ", sLine ELSE -//? "TOKEN = '" + sReturn + "' Len: ", Len( sReturn ), "AT: ", sLine + //? "TOKEN = '" + sReturn + "' Len: ", Len( sReturn ), "AT: ", sLine sLine := SubStr( sLine, Len( sReturn ) + 1 ) s_cLastChar := Right( sReturn, 1 ) sReturn += ExtractLeadingWS( @sLine ) @@ -2022,10 +2018,9 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) RETURN NIL ENDIF - IF sToken == '->' + IF Left( sToken, 2 ) == '->' sExp := sToken - sExp += ExtractLeadingWS( @sLine ) IF sNextAnchor != '->' sTemp := NextExp( @sLine, '<', NIL, NIL, sNextAnchor ) @@ -2036,10 +2031,9 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) ENDIF ENDIF - ELSEIF sToken == ':=' + ELSEIF Left( sToken, 2 ) == ':=' sExp := sToken - sExp += ExtractLeadingWS( @sLine ) IF sNextAnchor != ':=' sTemp := NextExp( @sLine, '<', NIL, NIL, sNextAnchor ) @@ -2053,7 +2047,6 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) ELSEIF Left( sToken, 1 ) == '!' sExp := sToken - sExp += ExtractLeadingWS( @sLine ) IF sNextAnchor != '!' sTemp := NextExp( @sLine, '<', NIL, NIL, sNextAnchor ) @@ -2066,17 +2059,20 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) ELSEIF Left( sToken, 1 ) == ')' - sExp := NIL + IF sNextAnchor == ')' + sExp := sToken + ELSE + sExp := NIL + ENDIF ELSEIF Left( sToken, 1 ) == '(' sExp := sToken - sExp += ExtractLeadingWS( @sLine ) IF sNextAnchor != '(' sTemp := NextExp( @sLine, ',', NIL, NIL, sNextAnchor ) // Content IF sTemp == NIL - Alert( "ERROR! Unbalanced '('" ) + Alert( "ERROR! Unbalanced '(...'" ) ELSE sExp += sTemp ENDIF @@ -2091,12 +2087,15 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) ELSEIF Left( sToken, 1 ) == '}' - sExp := NIL + IF sNextAnchor == '}' + sExp := sToken + ELSE + sExp := NIL + ENDIF ELSEIF Left( sToken, 1 ) == '{' sExp := sToken - sExp += ExtractLeadingWS( @sLine ) IF sNextAnchor != '{' @@ -2145,15 +2144,17 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor ) ELSE /* Literal array */ - sTemp := NextExp( @sLine, ',', NIL, NIL, sNextAnchor ) // Content - IF sTemp == NIL - Alert( "ERROR! Unbalanced '{'" ) - ELSE - sExp += sTemp + IF Left( sLine, 1 ) != '}' + sTemp := NextExp( @sLine, ',', NIL, NIL, sNextAnchor ) // Content + IF sTemp == NIL + Alert( "ERROR! Unbalanced '{...'" ) + ELSE + sExp += sTemp + ENDIF ENDIF sToken := NextToken( @sLine, .T. ) /* bCheckRules */ // Close - IF sTemp == NIL + IF sToken == NIL Alert( "ERROR! Unbalanced '{'" ) ELSE sExp += sToken