2000-10-17 11:35 UTC+0800 Ron Pinkas <ron@profit-master.com>

* contrib/dot/pp.prg
      ! Fixed few more associations within NextExp()
      + Added logic to auto create vars refernced in command line.
	/* Now the DOT prompt is much more functional, in both Clipper and Harbour. */
This commit is contained in:
Ron Pinkas
2000-10-17 18:38:23 +00:00
parent 7d0080ab16
commit 1e28561f7b
2 changed files with 66 additions and 35 deletions

View File

@@ -1,3 +1,9 @@
2000-10-17 11:35 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
! Fixed few more associations within NextExp()
+ Added logic to auto create vars refernced in command line.
/* Now the DOT prompt is much more functional, in both Clipper and Harbour. */
2000-10-17 18:21 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* source/rtl/tbrowse.prg
! ::DispCell() was using Lef(Str(xValue)) when xValue was a Numeric one, this is

View File

@@ -99,6 +99,7 @@ RETURN
PROCEDURE RP_Dot()
LOCAL sLine := Space(256), bBlock, GetList := {}, sPPed, nNext, sBlock, sTemp
LOCAL sTemp2, nLen, sLeft, sSymbol
bCount := .F.
@@ -134,15 +135,65 @@ PROCEDURE RP_Dot()
sBlock := Left( sTemp, nNext - 1 )
ExtractLeadingWS( @sBlock )
DropTrailingWS( @sBlock )
sTemp2 := sBlock
WHILE ( nNext := At( ":=", sTemp2 ) ) > 0
sLeft := Left( sTemp2, nNext - 1 )
sTemp2 := SubStr( sTemp2, nNext + 2 )
DropTrailingWS( @sLeft )
nLen := Len( sLeft )
WHILE nLen > 0
IF SubStr( sLeft, nLen, 1 ) $ " (,=><*+-\^&@["
EXIT
ENDIF
nLen--
ENDDO
IF nLen == 0
sSymbol := sLeft
ELSE
sSymbol := SubStr( sLeft, nLen + 1 )
ENDIF
IF ( Type( sSymbol ) == 'U' )
PUBLIC &sSymbol
ENDIF
ENDDO
bBlock := &( "{|| " + sBlock + " }" )
Eval( bBlock )
sTemp := DropTrailingWS( SubStr( sTemp, nNext + 1 ) )
ExtractLeadingWS( @sTemp )
ENDDO
ExtractLeadingWS( @sTemp )
DropTrailingWS( @sTemp )
IF ! ( sTemp == '' )
bBlock := &( "{|| " + sTemp + " }" )
sTemp2 := sTemp
WHILE ( nNext := At( ":=", sTemp2 ) ) > 0
sLeft := Left( sTemp2, nNext - 1 )
sTemp2 := SubStr( sTemp2, nNext + 2 )
DropTrailingWS( @sLeft )
nLen := Len( sLeft )
WHILE nLen > 0
IF SubStr( sLeft, nLen, 1 ) $ " (,=><*+-\^&@["
EXIT
ENDIF
nLen--
ENDDO
IF nLen == 0
sSymbol := sLeft
ELSE
sSymbol := SubStr( sLeft, nLen + 1 )
ENDIF
IF ( Type( sSymbol ) == 'U' )
PUBLIC &sSymbol
ENDIF
ENDDO
sTemp := "{|| " + sTemp + " }"
bBlock := &sTemp
Eval( bBlock )
ENDIF
@ 0,0 SAY "PP: "
@@ -1680,7 +1731,7 @@ RETURN sReturn
FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor )
LOCAL sExp, nClose, cChar, sTemp, Counter, sWorkLine, sPad, sToken
LOCAL sExp, nClose, cChar, sTemp, Counter, sWorkLine, sPad, sToken, sGrabber
DO CASE
CASE cType == '*'
@@ -1945,9 +1996,12 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor )
EXIT
ELSEIF Left( sLine, 2 ) == "->" .AND. ( sNextAnchor == NIL .OR. ( ! ( sNextAnchor == "->" ) ) )
ELSEIF ( ( sGrabber := Left( sLine, 2 ) ) == "->" .OR. ;
sGrabber == ":=" .OR. sGrabber == "==" .OR. sGrabber == "!=" .OR. sGrabber == "<>" .OR. sGrabber == ">=" .OR. ;
sGrabber == "<=" .OR. sGrabber == "+=" .OR. sGrabber == "-=" .OR. sGrabber == "*=" .OR. sGrabber == "^=" ) ;
.AND. ( sNextAnchor == NIL .OR. ( ! ( sNextAnchor == sGrabber ) ) )
sExp += Left( sLine, 2 )
sExp += sGrabber
IF bDbgExp
? "Grabber: '" + sExp + "'"
@@ -1966,7 +2020,7 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor )
ELSE
sTemp := NextExp( @sLine, cType, NIL, NIL, sNextAnchor )
IF sTemp == NIL
Alert( "ERROR! Unbalanced: '->'" )
Alert( "ERROR! Unbalanced '" + sGrabber + "'" + "at: '" + sExp + "'" )
ELSE
sExp += sTemp
ENDIF
@@ -1974,36 +2028,7 @@ FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor )
LOOP
ELSEIF Left( sLine, 2 ) == ":=" .AND. ( sNextAnchor == NIL .OR. ( ! ( sNextAnchor == ":=" ) ) )
sExp += Left( sLine, 2 )
IF bDbgExp
? "Grabber: '" + sExp + "'"
ENDIF
sLine := SubStr( sLine, 3 )
sExp += ExtractLeadingWS( @sLine )
IF bDbgExp
? "Next : '" + sLine + "'"
WAIT
ENDIF
IF cType == 'A'
sExp += NextExp( @sLine, '<', NIL, NIL, sNextAnchor )
ELSE
sTemp := NextExp( @sLine, cType, NIL, NIL, sNextAnchor )
IF sTemp == NIL
Alert( "ERROR! Unbalanced: ':='" )
ELSE
sExp += sTemp
ENDIF
ENDIF
LOOP
ELSEIF Left( sLine, 1 ) $ "+-*/:=^!" .AND. ( sNextAnchor == NIL .OR. ( ! ( sNextAnchor $ "+-*/:=^!<>" ) ) )
ELSEIF Left( sLine, 1 ) $ "+-*/:=^!><" .AND. ( sNextAnchor == NIL .OR. ( ! ( sNextAnchor $ "+-*/:=^!<>" ) ) )
sExp += Left( sLine, 1 )