Поправлены правила. Исправлен параметр формирования деталировки
All checks were successful
CI / build-test (push) Successful in 31s
Release / pack-and-publish (release) Successful in 34s

This commit is contained in:
FrigaT
2025-12-29 02:19:30 +03:00
parent 507c466b5d
commit edc4d5c087
4 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ public class ConditionalBeginEndRule : BaseRuleVisitor, IRule
public override void Visit(IfStatement node)
{
if (node.ThenStatement != null && node.ThenStatement is not BeginEndBlockStatement)
if (node.ThenStatement != null && node.ThenStatement is not BeginEndBlockStatement && node.ThenStatement is not TryCatchStatement)
{
if (node.ThenStatement.StartLine != node.StartLine || node.ScriptTokenStream.Where(t => t.Offset <= node.ThenStatement.StartOffset + node.ThenStatement.FragmentLength).Max(t => t.Line) != node.StartLine)
{
@@ -25,7 +25,7 @@ public class ConditionalBeginEndRule : BaseRuleVisitor, IRule
}
}
if (node.ElseStatement != null && node.ElseStatement is not BeginEndBlockStatement && node.ElseStatement is not IfStatement)
if (node.ElseStatement != null && node.ElseStatement is not BeginEndBlockStatement && node.ElseStatement is not TryCatchStatement && node.ElseStatement is not IfStatement)
{
if (node.ElseStatement.StartLine != node.StartLine || node.ScriptTokenStream.Where(t => t.Offset <= node.ElseStatement.StartOffset + node.ElseStatement.FragmentLength).Max(t => t.Line) != node.StartLine)
{