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
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
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
Name | Type |
---|---|
other | Site |
Returns
referenceError
▸ referenceError(info?
): UserError
Returns a ReferenceError
Parameters
Name | Type |
---|---|
info? | string |
Returns
setCodeMapSite
▸ setCodeMapSite(site
): void
Parameters
Name | Type |
---|---|
site | Site |
Returns
void
setEndSite
▸ setEndSite(site
): void
Parameters
Name | Type |
---|---|
site | null | Site |
Returns
void
syntaxError
▸ syntaxError(info?
): UserError
Returns a SyntaxError
Parameters
Name | Type |
---|---|
info? | string |
Returns
toString
▸ toString(): string
Returns
string
transfer
▸ transfer(other
): any
Parameters
Name | Type |
---|---|
other | TransferUplcAst |
Returns
any
typeError
▸ typeError(info?
): UserError
Returns a TypeError
Parameters
Name | Type |
---|---|
info? | string |
Returns
dummy
▸ Static
dummy(): Site