Fan

 

class

compiler::TokenVal

sys::Obj
  compiler::Location
    compiler::TokenVal

TokenVal stores an instance of a Token at a specific Location.

Slots

equalsSource

override Bool equals(Obj? obj)

Overrides sys::Obj.equals

Doc inherited from sys::Obj.equals

Compare this object to the specified for equality. This method may be accessed via the == and != shortcut operators. If not overridden the default implementation compares for reference equality using the === operator. If this method is overridden, then hash() must also be overridden such that any two objects which return true for equals() must return the same value for hash(). This method must accept null and return false.

hashSource

override Int hash()

Overrides sys::Obj.hash

Doc inherited from sys::Obj.hash

Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.

isCallOpenParenSource

Bool isCallOpenParen()

Return if this token is a left opening paren, but only if on the same line:

Ok:

call(...)

Not ok:

call
  (...)
isIndexOpenBracketSource

Bool isIndexOpenBracket()

Return if this token is a left opening bracket, but only if on the same line:

Ok:

expr[...]

Not ok:

expr
  [...]
kindSource

Token kind

makeSource

new make(Token kind, Obj? val := null)

newlineSource

Bool newline

toStrSource

override Str toStr()

Overrides compiler::Location.toStr

Doc inherited from sys::Obj.toStr

Return a string representation of this object.

valSource

Obj? val

whitespaceSource

Bool whitespace