@hegeldev/hegel
    Preparing search index...

    Interface LarkOptions

    Options for fromLark.

    interface LarkOptions {
        alphabet?: string | Generator<string>;
        explicit?: Readonly<Record<string, Generator<string>>>;
        importPath?: string;
        maxDepth?: number;
        maxSize?: number;
        start?: string;
    }
    Index

    Properties

    alphabet?: string | Generator<string>

    The characters terminals drawn from their patterns may contain: a string of them, or a characters generator.

    explicit?: Readonly<Record<string, Generator<string>>>

    Generators for terminals whose values come from the test rather than from the grammar, by terminal name. Required for a terminal the grammar %declares without defining; any other terminal may be overridden.

    Each occurrence of the terminal in a generated string is a value drawn from its generator. The values are beyond the lexing checks the engine makes on the rest of the string: an %ignored terminal goes on either side of each where the grammar has one, and it is the generator's part to draw values that read as the terminal where they land (a value under a quoted-string terminal should contain no quote, say). The values count toward maxSize like any other characters: a string they push over it is drawn again with less room for the grammar's own text, and a draw that cannot fit them after a few tries rejects the test case.

    importPath?: string

    The directory %imported grammars are read from. %import a.b.X reads a/b.lark from it, and Lark's bundled common, python, unicode and lark grammars stand in when it has no such file. A relative import (%import .lib.X) in a/b.lark reads a/lib.lark, and in the grammar itself reads lib.lark; no bundled grammar stands in for it. Without an importPath, only the bundled grammars can be imported. Not supported in the browser, which has no filesystem.

    maxDepth?: number

    How deeply rules may nest (default 200, at most 500).

    maxSize?: number

    The most characters a string may have (default 8192, at most 1048576).

    start?: string

    The rule to generate strings of (default start, as in Lark).