class

FileLoc

@Js
const class FileLoc : Obj

FileLoc is a location within a text file or source string. It includes an optional one-base line number and column number. This class provides a standardized API for text based tools which need to report the line/column numbers of errors.

constructors makeFile

Constructor for file

make

Constructor for filename string

fields col

One based line column number or zero if unknown

synthetic

Constant for synthetic location

file

Filename location

inputs

Constant for tool input location

line

One based line number or zero if unknown

unknown

Constant for an unknown location

methods toStr

Return string representation as "file", "file(line)", or "file(line,col)"

compare

Comparison operator

isUnknown

Is this the unknown location

equals

Equality operator

hash

Hash code

col const Int : col

One based line column number or zero if unknown

compare virtual Int compare(Obj that)

Comparison operator

equals virtual Bool equals(Obj? that)

Equality operator

file const Str : file

Filename location

hash virtual Int hash()

Hash code

inputs const static FileLoc : inputs

Constant for tool input location

isUnknown Bool isUnknown()

Is this the unknown location

line const Int : line

One based line number or zero if unknown

make new make(Str file, Int line, Int col)

Constructor for filename string

makeFile static new makeFile(File file, Int line, Int col)

Constructor for file

synthetic const static FileLoc : synthetic

Constant for synthetic location

toStr virtual Str toStr()

Return string representation as "file", "file(line)", or "file(line,col)". This is the standard format used by the Fantom compiler.

unknown const static FileLoc : unknown

Constant for an unknown location

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST