diff options
Diffstat (limited to 'basic/source/comp/dim.cxx')
-rw-r--r-- | basic/source/comp/dim.cxx | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index e3efd59d68..36bbb8d551 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -238,12 +238,12 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) DefEnum( bPrivate ); return; } - else if( eCurTok == DECLARE )
- {
- Next();
- DefDeclare( bPrivate );
- return;
- }
+ else if( eCurTok == DECLARE ) + { + Next(); + DefDeclare( bPrivate ); + return; + } } #ifdef SHARED @@ -582,42 +582,42 @@ void SbiParser::DefType( BOOL bPrivate ) else { SbxProperty *pTypeElem = new SbxProperty (pElem->GetName(),pElem->GetType()); - if( pDim )
- {
- SbxDimArray* pArray = new SbxDimArray( pElem->GetType() );
- if ( pDim->GetSize() )
- {
- // Dimension the target array
-
- for ( short i=0; i<pDim->GetSize();++i )
- {
- INT32 ub = -1;
- INT32 lb = nBase;
- SbiExprNode* pNode = pDim->Get(i)->GetExprNode();
- ub = pNode->GetNumber();
- if ( !pDim->Get( i )->IsBased() ) // each dim is low/up
- {
- if ( ++i >= pDim->GetSize() ) // trouble
- StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
- pNode = pDim->Get(i)->GetExprNode();
- lb = ub;
- ub = pNode->GetNumber();
- }
- else if ( !bCompatible )
- ub += nBase;
- pArray->AddDim32( lb, ub );
- }
- pArray->setHasFixedSize( true );
- }
- else
- pArray->unoAddDim( 0, -1 ); // variant array
- USHORT nSavFlags = pTypeElem->GetFlags();
- // need to reset the FIXED flag
- // when calling PutObject ( because the type will not match Object )
- pTypeElem->ResetFlag( SBX_FIXED );
- pTypeElem->PutObject( pArray );
- pTypeElem->SetFlags( nSavFlags );
- }
+ if( pDim ) + { + SbxDimArray* pArray = new SbxDimArray( pElem->GetType() ); + if ( pDim->GetSize() ) + { + // Dimension the target array + + for ( short i=0; i<pDim->GetSize();++i ) + { + INT32 ub = -1; + INT32 lb = nBase; + SbiExprNode* pNode = pDim->Get(i)->GetExprNode(); + ub = pNode->GetNumber(); + if ( !pDim->Get( i )->IsBased() ) // each dim is low/up + { + if ( ++i >= pDim->GetSize() ) // trouble + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + pNode = pDim->Get(i)->GetExprNode(); + lb = ub; + ub = pNode->GetNumber(); + } + else if ( !bCompatible ) + ub += nBase; + pArray->AddDim32( lb, ub ); + } + pArray->setHasFixedSize( true ); + } + else + pArray->unoAddDim( 0, -1 ); // variant array + USHORT nSavFlags = pTypeElem->GetFlags(); + // need to reset the FIXED flag + // when calling PutObject ( because the type will not match Object ) + pTypeElem->ResetFlag( SBX_FIXED ); + pTypeElem->PutObject( pArray ); + pTypeElem->SetFlags( nSavFlags ); + } delete pDim; pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() ); } @@ -775,7 +775,7 @@ void SbiParser::DefEnum( BOOL bPrivate ) SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) { BOOL bFunc = BOOL( eCurTok == FUNCTION ); - BOOL bProp = BOOL( eCurTok == GET || eCurTok == SET || eCurTok == LET );
+ BOOL bProp = BOOL( eCurTok == GET || eCurTok == SET || eCurTok == LET ); if( !TestSymbol() ) return NULL; String aName( aSym ); SbxDataType eType = eScanType; @@ -896,7 +896,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) // if( pDef->GetType() == SbxOBJECT ) // pDef->SetType( SbxVARIANT ), // Error( SbERR_SYNTAX ); - if( pDef->GetType() == SbxVARIANT && !( bFunc || bProp ) )
+ if( pDef->GetType() == SbxVARIANT && !( bFunc || bProp ) ) pDef->SetType( SbxEMPTY ); return pDef; } @@ -905,11 +905,11 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) void SbiParser::Declare() { - DefDeclare( FALSE );
-}
-
-void SbiParser::DefDeclare( BOOL bPrivate )
-{
+ DefDeclare( FALSE ); +} + +void SbiParser::DefDeclare( BOOL bPrivate ) +{ Next(); if( eCurTok != SUB && eCurTok != FUNCTION ) Error( SbERR_UNEXPECTED, eCurTok ); @@ -938,8 +938,8 @@ void SbiParser::DefDeclare( BOOL bPrivate ) else aPublics.Add( pDef ); - if ( pDef )
- pDef->SetPublic( !bPrivate );
+ if ( pDef ) + pDef->SetPublic( !bPrivate ); } } } |