const class util::FileLoc

sys::Obj
  util::FileLoc

@Js

Source

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.

col

const Int col

Source

One based line column number or zero if unknown

compare

virtual override Int compare(Obj that)

Source

Comparison operator

equals

virtual override Bool equals(Obj? that)

Source

Equality operator

file

const Str file

Source

Filename location

hash

virtual override Int hash()

Source

Hash code

inputs

const static FileLoc inputs := FileLoc.make("inputs", 0)

Source

Constant for tool input location

isUnknown

Bool isUnknown()

Source

Is this the unknown location

line

const Int line

Source

One based line number or zero if unknown

make

new make(Str file, Int line := 0, Int col := 0)

Source

Constructor for filename string

makeFile

static new makeFile(File file, Int line := 0, Int col := 0)

Source

Constructor for file

synthetic

const static FileLoc synthetic := FileLoc.make("synthetic", 0)

Source

Constant for synthetic location

toStr

virtual override Str toStr()

Source

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 := FileLoc.make("unknown", 0)

Source

Constant for an unknown location