Table of Contents

Class AndPattern<T>

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines a pattern that requires a collection of sub-patterns to be satisfied.

public sealed record AndPattern<T> : Pattern<T>, IEquatable<Pattern>, IEquatable<Pattern<T>>, IEquatable<AndPattern<T>>

Type Parameters

T

The type of value to match.

Inheritance
AndPattern<T>
Implements
Inherited Members

Constructors

AndPattern(ImmutableArray<Pattern<T>>)

Defines a pattern that requires a collection of sub-patterns to be satisfied.

public AndPattern(ImmutableArray<Pattern<T>> Operands)

Parameters

Operands ImmutableArray<Pattern<T>>

The sub-patterns that all need to be satisfied.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Operands

The sub-patterns that all need to be satisfied.

public ImmutableArray<Pattern<T>> Operands { get; init; }

Property Value

ImmutableArray<Pattern<T>>

Methods

Deconstruct(out ImmutableArray<Pattern<T>>)

public void Deconstruct(out ImmutableArray<Pattern<T>> Operands)

Parameters

Operands ImmutableArray<Pattern<T>>

Equals(AndPattern<T>?)

public bool Equals(AndPattern<T>? other)

Parameters

other AndPattern<T>

Returns

bool

Equals(Pattern<T>?)

public override sealed bool Equals(Pattern<T>? other)

Parameters

other Pattern<T>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(T, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<T>? Match(T input, MatchingContext context)

Parameters

input T

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<T>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(AndPattern<T>?, AndPattern<T>?)

public static bool operator ==(AndPattern<T>? left, AndPattern<T>? right)

Parameters

left AndPattern<T>
right AndPattern<T>

Returns

bool

operator !=(AndPattern<T>?, AndPattern<T>?)

public static bool operator !=(AndPattern<T>? left, AndPattern<T>? right)

Parameters

left AndPattern<T>
right AndPattern<T>

Returns

bool