Table of Contents

Class SequenceRule

Namespace
BlazOrbit.SyntaxHighlight.Rules
Assembly
BlazOrbit.SyntaxHighlight.dll

Matches an exact character sequence.

public sealed class SequenceRule : ITokenRule
Inheritance
object
SequenceRule
Implements

Constructors

SequenceRule(TokenType, string, int)

Initializes a new instance of the SequenceRule class.

public SequenceRule(TokenType tokenType, string sequence, int priority = 0)

Parameters

tokenType TokenType
sequence string
priority int

Properties

Priority

Gets the priority of this rule. Higher values are evaluated first.

public int Priority { get; }

Property Value

int

Methods

TryMatch(string, int, TokenizerContext)

Attempts to match the sequence at the specified position.

public TokenMatch? TryMatch(string input, int position, TokenizerContext context)

Parameters

input string
position int
context TokenizerContext

Returns

TokenMatch?