Skip to main content

Source

export interface Source {
  content: string
  getChar(i: number): string
  getPosition(i: number): [number, number]
  getWord(i: number): string
  length: number
  lineEndLocations: number[]
  moduleName: string
  moreInfo: string
  name: string
  pretty(): string
  project: string
  purpose: string
}

Properties

content

source.content satisfies string

getChar

source.getChar satisfies (i: number) => string

getPosition

source.getPosition satisfies (i: number) => [number, number]

getWord

source.getWord satisfies (i: number) => string

length

length is a separate field because of performance

source.length satisfies number

lineEndLocations

source.lineEndLocations satisfies number[]

moduleName

optional helios-specific script/module name, parsed from the script header

source.moduleName satisfies string

moreInfo

optional additional info about the source

source.moreInfo satisfies string

name

provided filename (or script name parsed from script header)

source.name satisfies string

pretty

source.pretty satisfies () => string

project

optional project name in which the module is defined

source.project satisfies string

purpose

optional helios-specific script purpose, parsed from the script header

source.purpose satisfies string