Class SequenceRule
- Namespace
- BlazOrbit.SyntaxHighlight.Rules
- Assembly
- BlazOrbit.SyntaxHighlight.dll
Matches an exact character sequence.
public sealed class SequenceRule : ITokenRule
- Inheritance
-
objectSequenceRule
- Implements
Constructors
SequenceRule(TokenType, string, int)
Initializes a new instance of the SequenceRule class.
public SequenceRule(TokenType tokenType, string sequence, int priority = 0)
Parameters
tokenTypeTokenTypesequencestringpriorityint
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
inputstringpositionintcontextTokenizerContext