Class DelimitedRule
- Namespace
- BlazOrbit.SyntaxHighlight.Rules
- Assembly
- BlazOrbit.SyntaxHighlight.dll
Matches tokens delimited by start and end sequences, such as strings or comments.
public sealed class DelimitedRule : ITokenRule
- Inheritance
-
objectDelimitedRule
- Implements
Constructors
DelimitedRule(TokenType, string, string, string?, bool, int)
Initializes a new instance of the DelimitedRule class.
public DelimitedRule(TokenType tokenType, string start, string end, string? escape = null, bool multiline = true, int priority = 0)
Parameters
tokenTypeTokenTypestartstringendstringescapestringmultilineboolpriorityint
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 a delimited token at the specified position.
public TokenMatch? TryMatch(string input, int position, TokenizerContext context)
Parameters
inputstringpositionintcontextTokenizerContext