clarified modules;
authorwenzelm
Mon, 15 Sep 2025 23:25:20 +0200
changeset 83161 87ceb18f23f3
parent 83160 bc86832bd2fd
child 83162 0eed8d2e7d81
child 83163 64c9d94478b8
clarified modules;
src/Pure/PIDE/document_status.scala
--- a/src/Pure/PIDE/document_status.scala	Mon Sep 15 23:07:57 2025 +0200
+++ b/src/Pure/PIDE/document_status.scala	Mon Sep 15 23:25:20 2025 +0200
@@ -8,20 +8,23 @@
 
 
 object Document_Status {
+  /* theory status: via 'theory' or 'end' commands */
+
+  object Theory_Status extends Enumeration {
+    val NONE, INITIALIZED, FINALIZED, CONSOLIDATING, CONSOLIDATED = Value
+
+    def initialized(t: Value): Boolean = t >= INITIALIZED
+    def finalized(t: Value): Boolean = t >= FINALIZED
+    def consolidating(t: Value): Boolean = t >= CONSOLIDATING
+    def consolidated(t: Value): Boolean = t >= CONSOLIDATED
+
+    def merge(t1: Value, t2: Value): Value = if (t1 >= t2) t1 else t2
+  }
+
+
   /* command status */
 
   object Command_Status {
-    object Theory_Status extends Enumeration {
-      val NONE, INITIALIZED, FINALIZED, CONSOLIDATING, CONSOLIDATED = Value
-
-      def initialized(t: Value): Boolean = t >= INITIALIZED
-      def finalized(t: Value): Boolean = t >= FINALIZED
-      def consolidating(t: Value): Boolean = t >= CONSOLIDATING
-      def consolidated(t: Value): Boolean = t >= CONSOLIDATED
-
-      def merge(t1: Value, t2: Value): Value = if (t1 >= t2) t1 else t2
-    }
-
     val proper_elements: Markup.Elements =
       Markup.Elements(Markup.ACCEPTED, Markup.FORKED, Markup.JOINED, Markup.RUNNING,
         Markup.FINISHED, Markup.FAILED, Markup.CANCELED)
@@ -81,7 +84,7 @@
   }
 
   final class Command_Status private(
-    private val theory_status: Command_Status.Theory_Status.Value,
+    private val theory_status: Theory_Status.Value,
     private val touched: Boolean,
     private val accepted: Boolean,
     private val warned: Boolean,
@@ -97,7 +100,7 @@
       else "Command_Status(...)"
 
     def is_empty: Boolean =
-      !Command_Status.Theory_Status.initialized(theory_status) &&
+      !Theory_Status.initialized(theory_status) &&
       !touched && !accepted && !warned && !failed && !canceled &&
       forks == 0 && runs == 0
 
@@ -106,7 +109,7 @@
       else if (that.is_empty) this
       else {
         new Command_Status(
-          theory_status = Command_Status.Theory_Status.merge(theory_status, that.theory_status),
+          theory_status = Theory_Status.merge(theory_status, that.theory_status),
           touched = touched || that.touched,
           accepted = accepted || that.accepted,
           warned = warned || that.warned,
@@ -116,10 +119,10 @@
           runs = runs + that.runs)
       }
 
-    def initialized: Boolean = Command_Status.Theory_Status.initialized(theory_status)
-    def finalized: Boolean = Command_Status.Theory_Status.finalized(theory_status)
-    def consolidating: Boolean = Command_Status.Theory_Status.consolidating(theory_status)
-    def consolidated: Boolean = Command_Status.Theory_Status.consolidated(theory_status)
+    def initialized: Boolean = Theory_Status.initialized(theory_status)
+    def finalized: Boolean = Theory_Status.finalized(theory_status)
+    def consolidating: Boolean = Theory_Status.consolidating(theory_status)
+    def consolidated: Boolean = Theory_Status.consolidated(theory_status)
     def maybe_consolidated: Boolean = touched && forks == 0 && runs == 0
 
     def is_unprocessed: Boolean = accepted && !failed && (!touched || (forks != 0 && runs == 0))