diff --git a/apps/openmw_tests/mwscript/testscripts.cpp b/apps/openmw_tests/mwscript/testscripts.cpp index 299d40b82c..95abeaf3c6 100644 --- a/apps/openmw_tests/mwscript/testscripts.cpp +++ b/apps/openmw_tests/mwscript/testscripts.cpp @@ -518,6 +518,16 @@ MessageBox "use strings that start with numbers, - and ." 1 -2 3.14pi .todd "A" MessageBox "use keywords" messagebox set "messagebox2" "set2" MessageBox "don't use more than 10 buttons" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" +End)mwscript"; + + const std::string sIssue8990 = R"mwscript(Begin issue8990 + +short a + +set a to 1 +MessageBox "%g" a +player->setacrobatics 5000 + End)mwscript"; TEST_F(MWScriptTest, mwscript_test_invalid) @@ -1037,4 +1047,10 @@ End)mwscript"; FAIL(); } } + + TEST_F(MWScriptTest, mwscript_test_8990) + { + registerExtensions(); + EXPECT_FALSE(!compile(sIssue8990)); + } } diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index 451dbe42ed..447fe20da5 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -77,6 +77,12 @@ namespace Compiler mTolerantNames = tolerant; return cont; } + // These are reset when the newline is read, but they could have been re-enabled + if (mPutbackCode == S_newline) + { + mTolerantNames = false; + mExpectName = false; + } return parser.parseSpecial(mPutbackCode, mPutbackLoc, *this); }