UNPKG

cm-tarnation

Version:

An alternative parser for CodeMirror 6

27 lines (26 loc) 905 B
import type { MatchOutput } from "../../types"; import type * as DF from "../definition"; import type { Repository } from "../repository"; import { Rule } from "./rule"; /** * A {@link Rule} subclass that uses {@link RegExpMatcher} or * {@link StringMatcher} instances for the underlying pattern. */ export declare class PatternRule extends Rule { /** * A list of patterns to check. This is a list of alternatives, so if any * matches, the rule matches. */ private patterns; exec: (str: string, pos: number) => MatchOutput; /** * @param repo - The {@link Repository} to add this rule to. * @param rule - The rule definition. */ constructor(repo: Repository, rule: DF.Pattern); /** * Internal function that is set as the `exec` method when the `patterns` * list is being used. */ private execPatterns; }