src/Pure/PIDE/document_id.scala
author wenzelm
Fri, 01 Apr 2022 17:06:10 +0200
changeset 75393 87ebf5a50283
parent 71601 97ccf48c2f0c
permissions -rw-r--r--
clarified formatting, for the sake of scala3;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52530
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     1
/*  Title:      Pure/PIDE/document_id.scala
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     3
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     4
Unique identifiers for document structure.
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     5
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     6
NB: ML ticks forwards > 0, JVM ticks backwards < 0.
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     7
*/
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     8
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
     9
package isabelle
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
    10
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
    11
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 71601
diff changeset
    12
object Document_ID {
52531
21f8e0e151f5 tuned signature;
wenzelm
parents: 52530
diff changeset
    13
  type Generic = Long
21f8e0e151f5 tuned signature;
wenzelm
parents: 52530
diff changeset
    14
  type Version = Generic
21f8e0e151f5 tuned signature;
wenzelm
parents: 52530
diff changeset
    15
  type Command = Generic
21f8e0e151f5 tuned signature;
wenzelm
parents: 52530
diff changeset
    16
  type Exec = Generic
52530
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
    17
52531
21f8e0e151f5 tuned signature;
wenzelm
parents: 52530
diff changeset
    18
  val none: Generic = 0
71601
97ccf48c2f0c misc tuning based on hints by IntelliJ IDEA;
wenzelm
parents: 66415
diff changeset
    19
  val make: Counter = Counter.make()
52530
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
    20
63805
c272680df665 clarified modules;
wenzelm
parents: 56744
diff changeset
    21
  def apply(id: Generic): String = Value.Long.apply(id)
c272680df665 clarified modules;
wenzelm
parents: 56744
diff changeset
    22
  def unapply(s: String): Option[Generic] = Value.Long.unapply(s)
52530
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff changeset
    23
}