summaryrefslogtreecommitdiff
path: root/basic/source/comp/parser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/comp/parser.cxx')
-rw-r--r--basic/source/comp/parser.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 69643715a9..eecc2291e3 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -29,6 +29,7 @@
#include "precompiled_basic.hxx"
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
+#include <com/sun/star/script/ModuleType.hpp>
struct SbiParseStack { // "Stack" fuer Statement-Blocks
SbiParseStack* pNext; // Chain
@@ -140,7 +141,8 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
bNewGblDefs =
bSingleLineIf =
bExplicit = FALSE;
- bClassModule = FALSE;
+ bClassModule = ( pm->GetModuleType() == com::sun::star::script::ModuleType::CLASS );
+ OSL_TRACE("Parser - %s, bClassModule %d", rtl::OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule );
pPool = &aPublics;
for( short i = 0; i < 26; i++ )
eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp
@@ -153,6 +155,10 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen
rEnumArray = new SbxArray; // Array for Enum types
+ bVBASupportOn = pm->IsVBACompat();
+ if ( bVBASupportOn )
+ EnableCompatibility();
+
}
@@ -751,6 +757,7 @@ void SbiParser::Option()
case CLASSMODULE:
bClassModule = TRUE;
+ aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::CLASS );
break;
case VBASUPPORT:
if( Next() == NUMBER )
@@ -760,6 +767,10 @@ void SbiParser::Option()
bVBASupportOn = ( nVal == 1 );
if ( bVBASupportOn )
EnableCompatibility();
+ // if the module setting is different
+ // reset it to what the Option tells us
+ if ( bVBASupportOn != aGen.GetModule().IsVBACompat() )
+ aGen.GetModule().SetVBACompat( bVBASupportOn );
break;
}
}