diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2022-05-25 12:42:23 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-06-01 12:30:36 +0200 |
commit | 78b6d38ceeb5f231b89123aade179a184517ebef (patch) | |
tree | 40deaa72c4c6caa5b07cc5c6027b86c8935c2374 | |
parent | 587ac574a894a0efd35a3607070edfe1d69cc8ee (diff) |
tdf#149157 - Break multiline continuation in a comment after a new line
Change-Id: I3dd875152a6f2cfafb67f13f597c36f01a4759b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135018
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
(cherry picked from commit b94275f6d2cb4dc28d1563fd7994251042b6d51a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135164
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | basic/qa/cppunit/test_compiler_checks.cxx | 40 | ||||
-rw-r--r-- | basic/source/comp/scanner.cxx | 2 |
2 files changed, 42 insertions, 0 deletions
diff --git a/basic/qa/cppunit/test_compiler_checks.cxx b/basic/qa/cppunit/test_compiler_checks.cxx index 24b380ed2a9a..e2882f3f694c 100644 --- a/basic/qa/cppunit/test_compiler_checks.cxx +++ b/basic/qa/cppunit/test_compiler_checks.cxx @@ -33,4 +33,44 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testDoubleArgument) CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_VAR_DEFINED, aMacro.getError().StripDynamic()); } +CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157) +{ + MacroSnippet aMacro("Function extentComment() As Integer\n" + " ' _\n" + " If Not extentComment Then\n" + " extentComment = 1\n" + " End If\n" + "End Function\n"); + aMacro.Compile(); + CPPUNIT_ASSERT(!aMacro.HasError()); +} + +CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_compatible) +{ + MacroSnippet aMacro("Option Compatible\n" + "Function extentComment() As Integer\n" + " ' _\n" + "\n" + " If Not extentComment Then\n" + " extentComment = 1\n" + " End If\n" + "End Function\n"); + aMacro.Compile(); + CPPUNIT_ASSERT(!aMacro.HasError()); +} + +CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testTdf149157_vba) +{ + MacroSnippet aMacro("Option VBASupport 1\n" + "Function extentComment() As Integer\n" + " ' _\n" + "\n" + " If Not extentComment Then\n" + " extentComment = 1\n" + " End If\n" + "End Function\n"); + aMacro.Compile(); + CPPUNIT_ASSERT(!aMacro.HasError()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index a0d9b9ab6c76..d391e7b6dff2 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -701,6 +701,8 @@ eoln: aSym = "\n"; nColLock = 0; bClosingUnderscore = false; + // tdf#149157 - break multiline continuation in a comment after a new line + bPrevLineExtentsComment = false; return true; } } |