src/Pure/PIDE/document_id.scala
author wenzelm
Tue, 21 Oct 2014 17:49:51 +0200
changeset 58749 83b0f633190e
parent 56744 0b74d1df4b8e
child 63805 c272680df665
permissions -rw-r--r--
some structure matching, based on line token iterators;

/*  Title:      Pure/PIDE/document_id.scala
    Module:     PIDE
    Author:     Makarius

Unique identifiers for document structure.

NB: ML ticks forwards > 0, JVM ticks backwards < 0.
*/

package isabelle


object Document_ID
{
  type Generic = Long
  type Version = Generic
  type Command = Generic
  type Exec = Generic

  val none: Generic = 0
  val make = Counter.make()

  def apply(id: Generic): String = Properties.Value.Long.apply(id)
  def unapply(s: String): Option[Generic] = Properties.Value.Long.unapply(s)
}