mib17: #162898# Special handling for ByVal followed by StrPtr

This commit is contained in:
Andreas Bregas
2010-07-06 15:59:41 +02:00
parent bb09a0aa84
commit dba973219b

View File

@@ -971,11 +971,16 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa
else else
{ {
bool bByVal = false; bool bByVal = false;
bool bByValBlockLValueError = false;
if( eTok == BYVAL ) if( eTok == BYVAL )
{ {
bByVal = true; bByVal = true;
pParser->Next(); pParser->Next();
eTok = pParser->Peek(); eTok = pParser->Peek();
// Special handling for VBA function "StrPtr" that's accepted as lvalue
if( eTok == SYMBOL && pParser->GetSym().EqualsIgnoreCaseAscii( "StrPtr" ) )
bByValBlockLValueError = true;
} }
if( bAssumeExprLParenMode ) if( bAssumeExprLParenMode )
@@ -1011,7 +1016,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa
if( bByVal ) if( bByVal )
{ {
if( !pExpr->IsLvalue() ) if( !pExpr->IsLvalue() && !bByValBlockLValueError )
pParser->Error( SbERR_LVALUE_EXPECTED ); pParser->Error( SbERR_LVALUE_EXPECTED );
else else
pExpr->SetByVal(); pExpr->SetByVal();