2001-06-22 07:55 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
+ Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2001-06-22 07:55 UTC-0800 Ron Pinkas <ron@profit-master.com>
|
||||
* contrib/dot/pp.prg
|
||||
+ Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
|
||||
|
||||
2001-06-22 07:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
|
||||
* source/pp/ppcore.c
|
||||
+ Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
|
||||
|
||||
@@ -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: '<!' at: " + sRule )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
OTHERWISE
|
||||
cType := NIL // Reset - not known yet.
|
||||
sRule := SubStr( sRule, 2 )
|
||||
|
||||
Reference in New Issue
Block a user