Files
PURErat-crack-scode/decompiled/Libraries/microsoft.codeanalysis.csharp/Microsoft.CodeAnalysis.CSharp.Syntax/IfDirectiveTriviaSyntax.cs
T
2026-08-27 10:56:38 -06:00

153 lines
7.5 KiB
C#

using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
public sealed class IfDirectiveTriviaSyntax : ConditionalDirectiveTriviaSyntax
{
private ExpressionSyntax? condition;
public override SyntaxToken HashToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).hashToken, ((SyntaxNode)this).Position, 0);
public SyntaxToken IfKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).ifKeyword, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1));
public override ExpressionSyntax Condition => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref condition, 2);
public override SyntaxToken EndOfDirectiveToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).endOfDirectiveToken, ((SyntaxNode)this).GetChildPosition(3), ((SyntaxNode)this).GetChildIndex(3));
public override bool IsActive => ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).IsActive;
public override bool BranchTaken => ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).BranchTaken;
public override bool ConditionValue => ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfDirectiveTriviaSyntax)(object)((SyntaxNode)this).Green).ConditionValue;
internal IfDirectiveTriviaSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)
: base(green, parent, position)
{
}
internal override SyntaxNode? GetNodeSlot(int index)
{
if (index != 2)
{
return null;
}
return (SyntaxNode?)(object)((SyntaxNode)this).GetRed<ExpressionSyntax>(ref condition, 2);
}
internal override SyntaxNode? GetCachedSlot(int index)
{
if (index != 2)
{
return null;
}
return (SyntaxNode?)(object)condition;
}
public override void Accept(CSharpSyntaxVisitor visitor)
{
visitor.VisitIfDirectiveTrivia(this);
}
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
{
return visitor.VisitIfDirectiveTrivia(this);
}
public IfDirectiveTriviaSyntax Update(SyntaxToken hashToken, SyntaxToken ifKeyword, ExpressionSyntax condition, SyntaxToken endOfDirectiveToken, bool isActive, bool branchTaken, bool conditionValue)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
if (hashToken != HashToken || ifKeyword != IfKeyword || condition != Condition || endOfDirectiveToken != EndOfDirectiveToken)
{
IfDirectiveTriviaSyntax ifDirectiveTriviaSyntax = SyntaxFactory.IfDirectiveTrivia(hashToken, ifKeyword, condition, endOfDirectiveToken, isActive, branchTaken, conditionValue);
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
if (annotations == null || annotations.Length == 0)
{
return ifDirectiveTriviaSyntax;
}
return ifDirectiveTriviaSyntax.WithAnnotations(annotations);
}
return this;
}
internal override DirectiveTriviaSyntax WithHashTokenCore(SyntaxToken hashToken)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return WithHashToken(hashToken);
}
public new IfDirectiveTriviaSyntax WithHashToken(SyntaxToken hashToken)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return Update(hashToken, IfKeyword, Condition, EndOfDirectiveToken, IsActive, BranchTaken, ConditionValue);
}
public IfDirectiveTriviaSyntax WithIfKeyword(SyntaxToken ifKeyword)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, ifKeyword, Condition, EndOfDirectiveToken, IsActive, BranchTaken, ConditionValue);
}
internal override ConditionalDirectiveTriviaSyntax WithConditionCore(ExpressionSyntax condition)
{
return WithCondition(condition);
}
public new IfDirectiveTriviaSyntax WithCondition(ExpressionSyntax condition)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, IfKeyword, condition, EndOfDirectiveToken, IsActive, BranchTaken, ConditionValue);
}
internal override DirectiveTriviaSyntax WithEndOfDirectiveTokenCore(SyntaxToken endOfDirectiveToken)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return WithEndOfDirectiveToken(endOfDirectiveToken);
}
public new IfDirectiveTriviaSyntax WithEndOfDirectiveToken(SyntaxToken endOfDirectiveToken)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, IfKeyword, Condition, endOfDirectiveToken, IsActive, BranchTaken, ConditionValue);
}
public IfDirectiveTriviaSyntax WithIsActive(bool isActive)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, IfKeyword, Condition, EndOfDirectiveToken, isActive, BranchTaken, ConditionValue);
}
public IfDirectiveTriviaSyntax WithBranchTaken(bool branchTaken)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, IfKeyword, Condition, EndOfDirectiveToken, IsActive, branchTaken, ConditionValue);
}
public IfDirectiveTriviaSyntax WithConditionValue(bool conditionValue)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return Update(HashToken, IfKeyword, Condition, EndOfDirectiveToken, IsActive, BranchTaken, conditionValue);
}
}