LO 80731 - Incorrect syntax does compile, MID without end bracket

Pierre Lepage pierrelepage3 at gmail.com
Fri Aug 4 01:26:36 UTC 2017


Hi,

I have implemented a new warning option on compilation. I did not go too 
far. A simple checkbox "Warning On" and an "else" in the faulty 
structure causing the problem of the closing parenthesis does the trick. 
I have included a screen copy of the dialog with the "Warning On" option.

The behavior of StarBasic with the "Warning On" option would be as follows.

A) Warning On and active IDE window: Warning displayed on line where 
normally there would be an error.

B) Warning On and IDE window inactive: Warning at the beginning of the 
macro execution in the application window.

C) Warning Off: No tolerated error and no warning stop.

For the case of the closing parenthesis, the warning message could be 
the following: A closing parenthesis is missing in one or more 
expressions with the Mid function.


In ./basic/source/comp/exprtree.cxx:1055

if((pExprList->bBracket&&eTok==RPAREN)||SbiTokenizer::IsEoln(eTok))
{
if(SbiTokenizer::IsEoln(eTok)&&pExprList->bBracket&&!CodeCompleteOptions::IsWarningOn())
{
pParser->Error(ERRCODE_BASIC_EXPECTED,RPAREN);
pExprList->bError=true;
}
else
{
//Warningoncompile!
//"Closingparenthesisismissing."
}
break;
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170803/897265cc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jpomamhngijmfppn.png
Type: image/png
Size: 18877 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170803/897265cc/attachment.png>


More information about the LibreOffice mailing list