Table of Contents

Class MatchRule

Namespace
CStructSharp
Assembly
CStructSharp.dll

One recognition rule and whether a prepared matcher checks it.

public sealed record MatchRule : IEquatable<MatchRule>
Inheritance
MatchRule
Implements
Inherited Members

Constructors

MatchRule(string, string, string?, bool, string)

One recognition rule and whether a prepared matcher checks it.

public MatchRule(string Field, string Kind, string? Label, bool Checked, string Reason)

Parameters

Field string

Declaring field name.

Kind string

The declaration keyword: magic, expect or supports.

Label string

Optional authored label.

Checked bool

Whether recognition evaluates this rule.

Reason string

Why the rule is checked or excluded; recognition never promises successful parsing.

Properties

Checked

Whether recognition evaluates this rule.

public bool Checked { get; init; }

Property Value

bool

Field

Declaring field name.

public string Field { get; init; }

Property Value

string

Kind

The declaration keyword: magic, expect or supports.

public string Kind { get; init; }

Property Value

string

Label

Optional authored label.

public string? Label { get; init; }

Property Value

string

Reason

Why the rule is checked or excluded; recognition never promises successful parsing.

public string Reason { get; init; }

Property Value

string

Methods

Deconstruct(out string, out string, out string?, out bool, out string)

public void Deconstruct(out string Field, out string Kind, out string? Label, out bool Checked, out string Reason)

Parameters

Field string
Kind string
Label string
Checked bool
Reason string

Equals(MatchRule?)

public bool Equals(MatchRule? other)

Parameters

other MatchRule

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MatchRule?, MatchRule?)

public static bool operator ==(MatchRule? left, MatchRule? right)

Parameters

left MatchRule
right MatchRule

Returns

bool

operator !=(MatchRule?, MatchRule?)

public static bool operator !=(MatchRule? left, MatchRule? right)

Parameters

left MatchRule
right MatchRule

Returns

bool