logo

class

compiler::TokenVal

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

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

Slots

equals

override Bool equals(Obj obj)

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().

Source

hash

override Int 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.

Source

isCallOpenParen

Bool isCallOpenParen()

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

Ok:

call(...)

Not ok:

call
  (...)

Source

isIndexOpenBracket

Bool isIndexOpenBracket()

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

Ok:

expr[...]

Not ok:

expr
  [...]

Source

kind

Token kind

Source

make

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

Source

newline

Bool newline

Source

toStr

override Str toStr()

Return a string representation of this object.

Source

val

Obj val

Source