basic/source/comp/loops.cxx | 10 ---------- basic/source/comp/parser.cxx | 4 ---- basic/source/inc/parser.hxx | 1 - 3 files changed, 15 deletions(-)
New commits: commit 22ce7a733971fc529eae2d0253abce0924edf3bd Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu May 29 22:38:11 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat May 31 21:50:30 2025 +0200 Just let the normal "unexpected" error for unmatched loop/wend/until Otherwise, a code like sub foo wend end sub produces an error "End Sub is missing". Change-Id: I8e85f7037ab07f1bc1e98037f2a31ef0af45c63f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186090 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index bafe2cb7df57..4ad4d1fb08ae 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -363,16 +363,6 @@ void SbiParser::With() CloseBlock(); } -// LOOP/NEXT/WEND without construct - -void SbiParser::BadBlock() -{ - if( eEndTok ) - Error( ERRCODE_BASIC_BAD_BLOCK, eEndTok ); - else - Error( ERRCODE_BASIC_BAD_BLOCK, u"Loop/Next/Wend"_ustr ); -} - // On expr Goto/Gosub n,n,n... void SbiParser::OnGoto() diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 339d06a4f9c6..738ca6078560 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -85,10 +85,8 @@ const SbiStatement StmntTable [] = { { LET, &SbiParser::Assign, N, Y, }, // LET { LINE, &SbiParser::Line, N, Y, }, // LINE, -> LINE INPUT (#i92642) { LINEINPUT,&SbiParser::LineInput, N, Y, }, // LINE INPUT -{ LOOP, &SbiParser::BadBlock, N, Y, }, // LOOP { LSET, &SbiParser::LSet, N, Y, }, // LSET { NAME, &SbiParser::Name, N, Y, }, // NAME -{ NEXT, &SbiParser::BadBlock, N, Y, }, // NEXT { ON, &SbiParser::On, N, Y, }, // ON { OPEN, &SbiParser::Open, N, Y, }, // OPEN { OPTION, &SbiParser::Option, Y, N, }, // OPTION @@ -106,9 +104,7 @@ const SbiStatement StmntTable [] = { { STOP, &SbiParser::Stop, N, Y, }, // STOP { SUB, &SbiParser::SubFunc, Y, N, }, // SUB { TYPE, &SbiParser::Type, Y, N, }, // TYPE -{ UNTIL, &SbiParser::BadBlock, N, Y, }, // UNTIL { WHILE, &SbiParser::While, N, Y, }, // WHILE -{ WEND, &SbiParser::BadBlock, N, Y, }, // WEND { WITH, &SbiParser::With, N, Y, }, // WITH { WRITE, &SbiParser::Write, N, Y, }, // WRITE diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 4e03e6d39058..2cbfb7864f41 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -95,7 +95,6 @@ public: void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo ); // let or call void ErrorStmnt(); // ERROR n - void BadBlock(); // LOOP/WEND/NEXT void NoIf(); // ELSE/ELSE IF without IF void Assign(); // LET void Attribute();