diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ac5ae970a3..90bdcd9d12 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-06-22 07:55 UTC-0800 Ron Pinkas + * contrib/dot/pp.prg + + Added logic for new Idenitifier Match Marker which will only match Identifiers. + 2001-06-22 07:30 UTC-0800 Ron Pinkas * source/pp/ppcore.c + Added logic for new Idenitifier Match Marker which will only match Identifiers. diff --git a/harbour/contrib/dot/pp.prg b/harbour/contrib/dot/pp.prg index e68ee85a7b..18cac7fccb 100644 --- a/harbour/contrib/dot/pp.prg +++ b/harbour/contrib/dot/pp.prg @@ -4065,7 +4065,7 @@ STATIC FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor, bX ) LOCAL sNextLine, sNextToken, sLastToken, sJustToken, sJustNext, cLastChar LOCAL s1, s2, s4, s5, sNext1, sNext2, sNext4, sNext5, nLen, nNextLen LOCAL sWorkLine, sPrimaryStopper, nStoppers, nStopper, sStopLine, sStopper, ; - sMultiStopper, nSpaceAt, sNextStopper + sMultiStopper, nSpaceAt, sNextStopper, cChar IF Empty( sLine ) RETURN NIL @@ -4172,6 +4172,13 @@ STATIC FUNCTION NextExp( sLine, cType, aWords, aExp, sNextAnchor, bX ) //? "EXP <(>: " + sExp RETURN sExp + CASE cType == '!' + IF IsAlpha( cChar := Left( sLine, 1 ) ) .OR. cChar == '_' + RETURN NextToken( @sLine ) + ELSE + RETURN NIL + ENDIF + CASE cType == NIL RETURN "-" ENDCASE @@ -5286,6 +5293,33 @@ STATIC FUNCTION CompileRule( sRule, aRules, aResults, bX, bUpper ) RETURN .F. ENDIF + CASE SubStr( sRule, 2, 1 ) == '!' + cType := '!' + nNext := At( '!>', sRule ) + IF nNext > 0 + sMarker := SubStr( sRule, 3, nNext - 3 ) + ExtractLeadingWS( @sMarker ) + aAdd( aMarkers, sMarker ) + + sRule := SubStr( sRule, nNext + 2 ) + ExtractLeadingWS( @sRule ) + + aMatch := { nId, nOptional, sAnchor, cType, NIL } + //? aMatch[1], aMatch[2], aMatch[3], aMatch[4], aMatch[5] + aAdd( aRule[2], aMatch ) + + /* Next dependant optional will be marked as trailing. */ + IF nOptional > 0 + nOptional := ( -nOptional ) + ENDIF + + sAnchor := NIL + LOOP + ELSE + Alert( "ERROR! Unbalanced MP: '