@asciidoctor/core - v4.0.3
    Preparing search index...

    Class PreprocessorReader

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _conditionalStack: any[]
    _dir: any
    _document: any
    _includeProcessorExtensions: any
    _includes: any
    _lines: string[]
    _lookAhead: number
    _mark: any
    _maxdepth: { abs: number; curr: number; rel: number }
    _saved: any
    _skipping: boolean
    _sourcemap: any
    _unescapeNextLine: boolean
    file: any
    includeStack: any[]
    lineno: any
    path: any
    processLines: boolean
    sourceLines: string[]
    unterminated: any

    Accessors

    • get lines(): string[]

      Returns the remaining lines in forward order (first remaining line at index 0). The returned object is a mutable proxy so that element assignments like reader.lines[i] = newValue are reflected back into the internal reversed stack.

      Returns string[]

    • get logger(): any

      Returns any

    Methods

    • Parameters

      • msg: string
      • Optionalopts: { sourceLocation?: any }

      Returns void

    • Parameters

      • msg: string
      • Optionalopts: { includeLocation?: any; sourceLocation?: any }

      Returns void

    • Parameters

      • file: any
      • path: any
      • lineno: any

      Returns Cursor

    • Get the current include depth (number of nested includes).

      Returns number

    • Drain conditional stack at EOS; treat blank lines as lines (not as EOF). peekLine() returns undefined only at true EOF; '' for blank lines.

      Returns Promise<boolean>

    • Peek at the next line without consuming it.

      Parameters

      • Optionaldirect: boolean

        When true, bypass processLine and return the raw stack top.

      Returns any

      The next line, or undefined if there are no more lines.

    • Peek at the next num lines without consuming them.

      Parameters

      • Optionalnum: number
      • Optionaldirect: boolean

      Returns Promise<string[]>

    • Evaluate preprocessor directives as lines are visited.

      Parameters

      • line: string

      Returns Promise<string>

    • Push new source onto the reader, switching the include context.

      Parameters

      • data: string | string[]
      • Optionalfile: string
      • Optionalpath: string
      • Optionallineno: number
      • Optionalattributes: any

      Returns this

    • Read lines until a termination condition is met.

      Parameters

      • Optionaloptions: {
            breakOnBlankLines?: boolean;
            breakOnListContinuation?: boolean;
            context?: string;
            cursor?: Cursor;
            preserveLastLine?: boolean;
            readLastLine?: boolean;
            skipFirstLine?: boolean;
            skipLineComments?: boolean;
            skipProcessing?: boolean;
            terminator?: string;
        }
        • OptionalbreakOnBlankLines?: boolean

          Stop on blank lines.

        • OptionalbreakOnListContinuation?: boolean

          Stop on a list continuation (+).

        • Optionalcontext?: string

          Name used in unterminated-block warnings.

        • Optionalcursor?: Cursor

          Starting cursor for unterminated-block warnings.

        • OptionalpreserveLastLine?: boolean

          Push the terminating line back.

        • OptionalreadLastLine?: boolean

          Include the terminating line in result.

        • OptionalskipFirstLine?: boolean

          Skip the first line before scanning.

        • OptionalskipLineComments?: boolean

          Skip line comments.

        • OptionalskipProcessing?: boolean

          Disable line preprocessing for this call.

        • Optionalterminator?: string

          Line at which to stop.

      • Optionalfilter: Function

        Optional function(line) returning true to break.

      Returns Promise<string[]>