diff options
Diffstat (limited to 'basic/source/comp/parser.cxx')
-rwxr-xr-x[-rw-r--r--] | basic/source/comp/parser.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 670ca7384767..38189bc2025c 100644..100755 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,6 +50,7 @@ struct SbiStatement { #define N sal_False static SbiStatement StmntTable [] = { +{ ATTRIBUTE, &SbiParser::Attribute, Y, Y, }, // ATTRIBUTE { CALL, &SbiParser::Call, N, Y, }, // CALL { CLOSE, &SbiParser::Close, N, Y, }, // CLOSE { _CONST_, &SbiParser::Dim, Y, Y, }, // CONST @@ -387,6 +389,18 @@ sal_Bool SbiParser::Parse() Next(); return sal_True; } + // In vba it's possible to do Error.foobar ( even if it results in + // a runtime error + if ( eCurTok == _ERROR_ && IsVBASupportOn() ) // we probably need to define a subset of keywords where this madness applies e.g. if ( IsVBASupportOn() && SymbolCanBeRedined( eCurTok ) ) + { + SbiTokenizer tokens( *(SbiTokenizer*)this ); + tokens.Next(); + if ( tokens.Peek() == DOT ) + { + eCurTok = SYMBOL; + ePush = eCurTok; + } + } // Kommt ein Symbol, ist es entweder eine Variable( LET ) // oder eine SUB-Prozedur( CALL ohne Klammern ) // DOT fuer Zuweisungen im WITH-Block: .A=5 @@ -795,7 +809,7 @@ void SbiParser::Option() bClassModule = sal_True; aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::CLASS ); break; - case VBASUPPORT: + case VBASUPPORT: // Option VBASupport used to override the module mode ( in fact this must reset the mode if( Next() == NUMBER ) { if ( nVal == 1 || nVal == 0 ) @@ -861,3 +875,4 @@ void SbiParser::ErrorStmnt() aGen.Gen( _ERROR ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |