Helios API/ API Reference/ Classes/

Site

Each Token/Expression/Statement has a Site, which encapsulates a position in a Source

Index

Constructors

constructor

new Site(src, startPos, endPos?, codeMapSite?)

Parameters

NameType
srcSource
startPosnumber
endPos?number
codeMapSite?null | Site

Accessors

codeMapSite

get codeMapSite(): null | Site

Returns

null | Site

endPos

get endPos(): number

Returns

number

endSite

get endSite(): null | Site

Returns

null | Site

src

get src(): Source

Returns

Source

startPos

get startPos(): number

Returns

number

Methods

getFilePos

getFilePos(): [number, number, number, number]

Calculates the column,line position in 'this.#src'

Returns

[number, number, number, number]

  • [startLine, startCol, endLine, endCol]

merge

merge(other): Site

Parameters

NameType
otherSite

Returns

Site

referenceError

referenceError(info?): UserError

Returns a ReferenceError

Parameters

NameType
info?string

Returns

UserError

setCodeMapSite

setCodeMapSite(site): void

Parameters

NameType
siteSite

Returns

void

setEndSite

setEndSite(site): void

Parameters

NameType
sitenull | Site

Returns

void

syntaxError

syntaxError(info?): UserError

Returns a SyntaxError

Parameters

NameType
info?string

Returns

UserError

toString

toString(): string

Returns

string

transfer

transfer(other): any

Parameters

NameType
otherTransferUplcAst

Returns

any

typeError

typeError(info?): UserError

Returns a TypeError

Parameters

NameType
info?string

Returns

UserError

dummy

Static dummy(): Site

Returns

Site