Packages

final class Position extends MLValueWrapper[Position]

Represents a position (ML type Position.T) in the Isabelle process.

Positions represent locations in source files: line number, beginning offset (inclusive), end offset (exclusive). A position may also have an associated file name or an id. Line numbers and offsets start from 1. Offsets count Isabelle symbols (not UTF8 or UTF16 characters) in the whole text (not just the current line).

An instance of this class is merely a thin wrapper around an MLValue, all explanations and examples given for Context also apply here.

An implict MLValue.Converter can be imported from Implicits._. The representation of a position pos as an ML exception is E_Position pos.

Source
Position.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Position
  2. MLValueWrapper
  3. FutureValue
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def await: Unit

    Blocks until this future value is computed.

    Blocks until this future value is computed. (Or throws an exception if the computation fails.)

    Definition Classes
    MLValueWrapperFutureValue
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  7. def endOffset(implicit isabelle: Isabelle): Option[Int]
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def extract(text: String)(implicit isabelle: Isabelle): String

    Returns the substring at this position, given the complete source text.

  11. def extractUntil(end: Position, text: String)(implicit isabelle: Isabelle): String

    Returns the substring from this position's offset (inclusive) to another's offset (exclusive).

  12. def file(implicit isabelle: Isabelle): Option[String]
  13. def force: Position.this.type

    Waits till the computation of this value (in the Isabelle process) has finished.

    Waits till the computation of this value (in the Isabelle process) has finished. (Or until an exception is thrown.)

    returns

    this value, but it is guaranteed to have completed the computation

    Definition Classes
    FutureValue
  14. def forceFuture(implicit isabelle: Isabelle): Future[Position.this.type]

    A future containing this object with the computation completed.

    A future containing this object with the computation completed. In particular, if this value throws an exception upon computation, the future holds that exception.

    Roughly the same as Future { this.force }.

    Definition Classes
    FutureValue
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  17. def id(implicit isabelle: Isabelle): Option[String]

    Returns the id of the position.

    Returns the id of the position. Supported only since Isabelle2021

  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def line(implicit isabelle: Isabelle): Option[Int]
  20. val mlValue: MLValue[Position]

    An MLValue referencing this (in the Isabelle process).

    An MLValue referencing this (in the Isabelle process). Since this is just a thin wrapper around an MLValue, mlValue carries exactly the same data as this and can be converted back and forth quickly (no transfer of data to/from the Isabelle process involved).

    Same as MLValue(this), assuming the correct MLValue.Converter from the companion object for A is imported.

    Definition Classes
    PositionMLValueWrapper
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  24. def offset(implicit isabelle: Isabelle): Option[Int]
  25. def someFuture: Future[Any]

    Returns a future that completes when the computation of this object is complete.

    Returns a future that completes when the computation of this object is complete. (Or that holds an exception if that computation throws an exception.) However, upon successful completion, the future may return an arbitrary (and thus useless) value. May be faster to implement than forceFuture because there may be already a future available but that returns the wrong value.

    Definition Classes
    MLValueWrapperFutureValue
  26. def stateString: String

    A utility method that returns "" if this value was successfully computed, " (computing)" if it still computes, and " (failed)" if it finished with an exception.

    A utility method that returns "" if this value was successfully computed, " (computing)" if it still computes, and " (failed)" if it finished with an exception.

    This can be useful to constructing human readable messages about this value.

    Definition Classes
    FutureValue
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    Position → AnyRef → Any
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from MLValueWrapper[Position]

Inherited from FutureValue

Inherited from AnyRef

Inherited from Any

Ungrouped