cosmetics

This commit is contained in:
UbitUmarov
2024-11-18 03:00:26 +00:00
parent 2d3140fc9a
commit 95ef45ba7c
2 changed files with 9 additions and 5 deletions

View File

@@ -2835,7 +2835,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
// Output compare and branch instructions in a tree-like fashion so we do O(log2 n) comparisons.
defaultLabel ??= ilGen.DefineLabel("default");
OutputStrCase(testRVal, caseTreeTop, defaultLabel);
if(caseTreeTop is not null)
OutputStrCase(testRVal, caseTreeTop, defaultLabel);
// Output code for the cases themselves, in the order given by the programmer,
// so they fall through as programmer wants. This includes the default case, if any.

View File

@@ -3092,7 +3092,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
tokenStmtSwitch.testRVal = ParseRValParen(ref token);
if(tokenStmtSwitch.testRVal == null)
return null;
if(!(token is TokenKwBrcOpen))
if(token is not TokenKwBrcOpen)
{
ErrorMsg(token, "expecting open brace");
token = SkipPastSemi(token);
@@ -3101,7 +3101,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
token = token.nextToken;
TokenSwitchCase tokenSwitchCase = null;
bool haveComplained = false;
while(!(token is TokenKwBrcClose))
while(token is not TokenEnd && token is not TokenKwBrcClose)
{
if(token is TokenKwCase)
{
@@ -3178,11 +3178,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine
}
else if(!haveComplained)
{
ErrorMsg(token, "expecting case or default label");
ErrorMsg(token, "expecting switch case or default");
token = SkipPastSemi(token);
haveComplained = true;
}
}
if(tokenSwitchCase is null)
ErrorMsg(token, "expecting switch case or default");
token = token.nextToken;
return tokenStmtSwitch;
}
@@ -4329,7 +4332,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
{
int braceLevel = 0;
while(!(token is TokenEnd))
while(token is not TokenEnd)
{
if((token is TokenKwSemi) && (braceLevel == 0))
{