Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Source

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Source(source: string, index: number, line?: number, column?: number): Source
  • Source for parsing

    Parameters

    • source: string

      Source input

    • index: number

      Where in the input to begin parsing

    • Default value line: number = 1

      Line which source[index] is on

    • Default value column: number = 1

      Column which source[index] is on

    Returns Source

Properties

column

column: number

Column which source[index] is on

index

index: number

Where in the input to begin parsing

line

line: number

Line which source[index] is on

source

source: string

Source input

Methods

getRemaining

  • getRemaining(): string

match

  • Attempt to match the source against a regular expression

    Parameters

    • regexp: RegExp

      Regular expression to match

    • Optional message: undefined | string

      Error message if it fails

    Returns ParseResult<string> | ParseError

text

  • Attempt to match the source against a literal string

    Parameters

    • text: string

      Text to match

    • Optional message: undefined | string

      Error message, if it fails

    Returns ParseResult<string> | ParseError

Generated using TypeDoc