src/Pure/PIDE/markup.scala
author wenzelm
Fri Sep 26 15:05:11 2014 +0200 (2014-09-26)
changeset 58464 5e7fc9974aba
parent 58048 aa6296d09e0e
child 58544 340f130b3d38
permissions -rw-r--r--
support for sub-expression markup;
wenzelm@45670
     1
/*  Title:      Pure/PIDE/markup.scala
wenzelm@45673
     2
    Module:     PIDE
wenzelm@27958
     3
    Author:     Makarius
wenzelm@27958
     4
wenzelm@56743
     5
Quasi-abstract markup elements.
wenzelm@27958
     6
*/
wenzelm@27958
     7
wenzelm@27958
     8
package isabelle
wenzelm@27958
     9
wenzelm@27970
    10
wenzelm@32450
    11
object Markup
wenzelm@32450
    12
{
wenzelm@56743
    13
  /* elements */
wenzelm@56743
    14
wenzelm@56743
    15
  object Elements
wenzelm@56743
    16
  {
wenzelm@56743
    17
    def apply(elems: Set[String]): Elements = new Elements(elems)
wenzelm@56743
    18
    def apply(elems: String*): Elements = apply(Set(elems: _*))
wenzelm@56743
    19
    val empty: Elements = apply()
wenzelm@56743
    20
    val full: Elements =
wenzelm@56743
    21
      new Elements(Set.empty)
wenzelm@56743
    22
      {
wenzelm@56743
    23
        override def apply(elem: String): Boolean = true
wenzelm@56743
    24
        override def toString: String = "Elements.full"
wenzelm@56743
    25
      }
wenzelm@56743
    26
  }
wenzelm@56743
    27
wenzelm@56743
    28
  sealed class Elements private[Markup](private val rep: Set[String])
wenzelm@56743
    29
  {
wenzelm@56743
    30
    def apply(elem: String): Boolean = rep.contains(elem)
wenzelm@56743
    31
    def + (elem: String): Elements = new Elements(rep + elem)
wenzelm@56743
    32
    def ++ (elems: Elements): Elements = new Elements(rep ++ elems.rep)
wenzelm@56743
    33
    override def toString: String = rep.mkString("Elements(", ",", ")")
wenzelm@56743
    34
  }
wenzelm@56743
    35
wenzelm@56743
    36
wenzelm@45666
    37
  /* properties */
wenzelm@29184
    38
wenzelm@29184
    39
  val NAME = "name"
wenzelm@43780
    40
  val Name = new Properties.String(NAME)
wenzelm@42136
    41
wenzelm@29184
    42
  val KIND = "kind"
wenzelm@43780
    43
  val Kind = new Properties.String(KIND)
wenzelm@29184
    44
wenzelm@52854
    45
  val INSTANCE = "instance"
wenzelm@52854
    46
  val Instance = new Properties.String(INSTANCE)
wenzelm@52854
    47
wenzelm@29184
    48
wenzelm@50201
    49
  /* basic markup */
wenzelm@29184
    50
wenzelm@45666
    51
  val Empty = Markup("", Nil)
wenzelm@45666
    52
  val Broken = Markup("broken", Nil)
wenzelm@50201
    53
wenzelm@55551
    54
  class Markup_String(val name: String, prop: String)
wenzelm@55551
    55
  {
wenzelm@55551
    56
    private val Prop = new Properties.String(prop)
wenzelm@55551
    57
wenzelm@55551
    58
    def apply(s: String): Markup = Markup(name, Prop(s))
wenzelm@55551
    59
    def unapply(markup: Markup): Option[String] =
wenzelm@55551
    60
      if (markup.name == name) Prop.unapply(markup.properties) else None
wenzelm@55551
    61
  }
wenzelm@55551
    62
wenzelm@55551
    63
  class Markup_Int(val name: String, prop: String)
wenzelm@55551
    64
  {
wenzelm@55551
    65
    private val Prop = new Properties.Int(prop)
wenzelm@55551
    66
wenzelm@55551
    67
    def apply(i: Int): Markup = Markup(name, Prop(i))
wenzelm@55551
    68
    def unapply(markup: Markup): Option[Int] =
wenzelm@55551
    69
      if (markup.name == name) Prop.unapply(markup.properties) else None
wenzelm@55551
    70
  }
wenzelm@55551
    71
wenzelm@50201
    72
wenzelm@50201
    73
  /* formal entities */
wenzelm@50201
    74
wenzelm@50201
    75
  val BINDING = "binding"
wenzelm@50201
    76
  val ENTITY = "entity"
wenzelm@50201
    77
  val DEF = "def"
wenzelm@50201
    78
  val REF = "ref"
wenzelm@50201
    79
wenzelm@50201
    80
  object Entity
wenzelm@50201
    81
  {
wenzelm@50201
    82
    def unapply(markup: Markup): Option[(String, String)] =
wenzelm@50201
    83
      markup match {
wenzelm@55551
    84
        case Markup(ENTITY, props) =>
wenzelm@55551
    85
          (props, props) match {
wenzelm@55615
    86
            case (Kind(kind), Name(name)) => Some((kind, name))
wenzelm@50201
    87
            case _ => None
wenzelm@50201
    88
          }
wenzelm@50201
    89
        case _ => None
wenzelm@50201
    90
      }
wenzelm@50201
    91
  }
wenzelm@50201
    92
wenzelm@50201
    93
wenzelm@55672
    94
  /* completion */
wenzelm@55672
    95
wenzelm@55672
    96
  val COMPLETION = "completion"
wenzelm@55914
    97
  val NO_COMPLETION = "no_completion"
wenzelm@55672
    98
wenzelm@55672
    99
wenzelm@50201
   100
  /* position */
wenzelm@50201
   101
wenzelm@50201
   102
  val LINE = "line"
wenzelm@50201
   103
  val OFFSET = "offset"
wenzelm@50201
   104
  val END_OFFSET = "end_offset"
wenzelm@50201
   105
  val FILE = "file"
wenzelm@50201
   106
  val ID = "id"
wenzelm@50201
   107
wenzelm@50201
   108
  val DEF_LINE = "def_line"
wenzelm@50201
   109
  val DEF_OFFSET = "def_offset"
wenzelm@50201
   110
  val DEF_END_OFFSET = "def_end_offset"
wenzelm@50201
   111
  val DEF_FILE = "def_file"
wenzelm@50201
   112
  val DEF_ID = "def_id"
wenzelm@50201
   113
wenzelm@50201
   114
  val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)
wenzelm@50201
   115
  val POSITION = "position"
wenzelm@50201
   116
wenzelm@50201
   117
wenzelm@58464
   118
  /* expression */
wenzelm@58464
   119
wenzelm@58464
   120
  val EXPRESSION = "expression"
wenzelm@58464
   121
wenzelm@58464
   122
wenzelm@55550
   123
  /* embedded languages */
wenzelm@55550
   124
wenzelm@55666
   125
  val Symbols = new Properties.Boolean("symbols")
wenzelm@55666
   126
  val Antiquotes = new Properties.Boolean("antiquotes")
wenzelm@55828
   127
  val Delimited = new Properties.Boolean("delimited")
wenzelm@55615
   128
wenzelm@55550
   129
  val LANGUAGE = "language"
wenzelm@55615
   130
  object Language
wenzelm@55615
   131
  {
wenzelm@55616
   132
    val ML = "ML"
wenzelm@56278
   133
    val SML = "SML"
wenzelm@56843
   134
    val PATH = "path"
wenzelm@55616
   135
    val UNKNOWN = "unknown"
wenzelm@55616
   136
wenzelm@55828
   137
    def unapply(markup: Markup): Option[(String, Boolean, Boolean, Boolean)] =
wenzelm@55615
   138
      markup match {
wenzelm@55615
   139
        case Markup(LANGUAGE, props) =>
wenzelm@55828
   140
          (props, props, props, props) match {
wenzelm@55828
   141
            case (Name(name), Symbols(symbols), Antiquotes(antiquotes), Delimited(delimited)) =>
wenzelm@55828
   142
              Some((name, symbols, antiquotes, delimited))
wenzelm@55615
   143
            case _ => None
wenzelm@55615
   144
          }
wenzelm@55615
   145
        case _ => None
wenzelm@55615
   146
      }
wenzelm@55615
   147
  }
wenzelm@55550
   148
wenzelm@55550
   149
wenzelm@54702
   150
  /* external resources */
wenzelm@50201
   151
wenzelm@50201
   152
  val PATH = "path"
wenzelm@55551
   153
  val Path = new Markup_String(PATH, NAME)
wenzelm@50201
   154
wenzelm@54702
   155
  val URL = "url"
wenzelm@55551
   156
  val Url = new Markup_String(URL, NAME)
wenzelm@54702
   157
wenzelm@50201
   158
wenzelm@50201
   159
  /* pretty printing */
wenzelm@50201
   160
wenzelm@55551
   161
  val Block = new Markup_Int("block", "indent")
wenzelm@55551
   162
  val Break = new Markup_Int("break", "width")
wenzelm@50201
   163
wenzelm@51570
   164
  val ITEM = "item"
wenzelm@51574
   165
  val BULLET = "bullet"
wenzelm@51570
   166
wenzelm@50201
   167
  val SEPARATOR = "separator"
wenzelm@50201
   168
wenzelm@50201
   169
wenzelm@56548
   170
  /* text properties */
wenzelm@56548
   171
wenzelm@56548
   172
  val WORDS = "words"
wenzelm@50201
   173
wenzelm@50201
   174
  val HIDDEN = "hidden"
wenzelm@50201
   175
wenzelm@50201
   176
wenzelm@58048
   177
  /* misc entities */
wenzelm@50201
   178
wenzelm@50201
   179
  val CLASS = "class"
wenzelm@50201
   180
  val TYPE_NAME = "type_name"
wenzelm@50201
   181
  val FIXED = "fixed"
wenzelm@53378
   182
  val CASE = "case"
wenzelm@50201
   183
  val CONSTANT = "constant"
wenzelm@50201
   184
  val DYNAMIC_FACT = "dynamic_fact"
wenzelm@50201
   185
wenzelm@50201
   186
wenzelm@50201
   187
  /* inner syntax */
wenzelm@50201
   188
wenzelm@50201
   189
  val TFREE = "tfree"
wenzelm@50201
   190
  val TVAR = "tvar"
wenzelm@50201
   191
  val FREE = "free"
wenzelm@50201
   192
  val SKOLEM = "skolem"
wenzelm@50201
   193
  val BOUND = "bound"
wenzelm@50201
   194
  val VAR = "var"
wenzelm@50201
   195
  val NUMERAL = "numeral"
wenzelm@50201
   196
  val LITERAL = "literal"
wenzelm@50201
   197
  val DELIMITER = "delimiter"
wenzelm@50201
   198
  val INNER_STRING = "inner_string"
wenzelm@55033
   199
  val INNER_CARTOUCHE = "inner_cartouche"
wenzelm@50201
   200
  val INNER_COMMENT = "inner_comment"
wenzelm@50201
   201
wenzelm@50201
   202
  val TOKEN_RANGE = "token_range"
wenzelm@50201
   203
wenzelm@50201
   204
  val SORTING = "sorting"
wenzelm@50201
   205
  val TYPING = "typing"
wenzelm@50201
   206
wenzelm@50201
   207
  val ATTRIBUTE = "attribute"
wenzelm@50201
   208
  val METHOD = "method"
wenzelm@50201
   209
wenzelm@50201
   210
wenzelm@55550
   211
  /* antiquotations */
wenzelm@50201
   212
wenzelm@55526
   213
  val ANTIQUOTED = "antiquoted"
wenzelm@55526
   214
  val ANTIQUOTE = "antiquote"
wenzelm@55526
   215
wenzelm@50201
   216
  val ML_ANTIQUOTATION = "ML_antiquotation"
wenzelm@50201
   217
  val DOCUMENT_ANTIQUOTATION = "document_antiquotation"
wenzelm@50201
   218
  val DOCUMENT_ANTIQUOTATION_OPTION = "document_antiquotation_option"
wenzelm@50201
   219
wenzelm@50201
   220
wenzelm@50201
   221
  /* text structure */
wenzelm@50201
   222
wenzelm@50201
   223
  val PARAGRAPH = "paragraph"
wenzelm@50545
   224
  val TEXT_FOLD = "text_fold"
wenzelm@50201
   225
wenzelm@50201
   226
wenzelm@50201
   227
  /* ML syntax */
wenzelm@50201
   228
wenzelm@55505
   229
  val ML_KEYWORD1 = "ML_keyword1"
wenzelm@55505
   230
  val ML_KEYWORD2 = "ML_keyword2"
wenzelm@55505
   231
  val ML_KEYWORD3 = "ML_keyword3"
wenzelm@50201
   232
  val ML_DELIMITER = "ML_delimiter"
wenzelm@50201
   233
  val ML_TVAR = "ML_tvar"
wenzelm@50201
   234
  val ML_NUMERAL = "ML_numeral"
wenzelm@50201
   235
  val ML_CHAR = "ML_char"
wenzelm@50201
   236
  val ML_STRING = "ML_string"
wenzelm@50201
   237
  val ML_COMMENT = "ML_comment"
wenzelm@56278
   238
  val SML_STRING = "SML_string"
wenzelm@56278
   239
  val SML_COMMENT = "SML_comment"
wenzelm@50201
   240
wenzelm@50201
   241
  val ML_DEF = "ML_def"
wenzelm@50201
   242
  val ML_OPEN = "ML_open"
wenzelm@55837
   243
  val ML_STRUCTURE = "ML_structure"
wenzelm@50201
   244
  val ML_TYPING = "ML_typing"
wenzelm@50201
   245
wenzelm@50201
   246
wenzelm@50201
   247
  /* outer syntax */
wenzelm@50201
   248
wenzelm@55744
   249
  val COMMAND = "command"
wenzelm@55744
   250
  val KEYWORD1 = "keyword1"
wenzelm@55744
   251
  val KEYWORD2 = "keyword2"
wenzelm@55765
   252
  val KEYWORD3 = "keyword3"
wenzelm@55919
   253
  val QUASI_KEYWORD = "quasi_keyword"
wenzelm@56202
   254
  val IMPROPER = "improper"
wenzelm@50201
   255
  val OPERATOR = "operator"
wenzelm@50201
   256
  val STRING = "string"
wenzelm@50201
   257
  val ALTSTRING = "altstring"
wenzelm@50201
   258
  val VERBATIM = "verbatim"
wenzelm@55033
   259
  val CARTOUCHE = "cartouche"
wenzelm@50201
   260
  val COMMENT = "comment"
wenzelm@50201
   261
  val CONTROL = "control"
wenzelm@50201
   262
wenzelm@50201
   263
wenzelm@50201
   264
  /* timing */
wenzelm@50201
   265
wenzelm@50781
   266
  val Elapsed = new Properties.Double("elapsed")
wenzelm@50781
   267
  val CPU = new Properties.Double("cpu")
wenzelm@50781
   268
  val GC = new Properties.Double("gc")
wenzelm@50781
   269
wenzelm@50781
   270
  object Timing_Properties
wenzelm@50781
   271
  {
wenzelm@50781
   272
    def apply(timing: isabelle.Timing): Properties.T =
wenzelm@50781
   273
      Elapsed(timing.elapsed.seconds) ::: CPU(timing.cpu.seconds) ::: GC(timing.gc.seconds)
wenzelm@51662
   274
wenzelm@50781
   275
    def unapply(props: Properties.T): Option[isabelle.Timing] =
wenzelm@50781
   276
      (props, props, props) match {
wenzelm@50781
   277
        case (Elapsed(elapsed), CPU(cpu), GC(gc)) =>
wenzelm@50781
   278
          Some(new isabelle.Timing(Time.seconds(elapsed), Time.seconds(cpu), Time.seconds(gc)))
wenzelm@50781
   279
        case _ => None
wenzelm@50781
   280
      }
wenzelm@50781
   281
  }
wenzelm@50781
   282
wenzelm@50201
   283
  val TIMING = "timing"
wenzelm@50201
   284
wenzelm@50201
   285
  object Timing
wenzelm@50201
   286
  {
wenzelm@50781
   287
    def apply(timing: isabelle.Timing): Markup = Markup(TIMING, Timing_Properties(timing))
wenzelm@51662
   288
wenzelm@50201
   289
    def unapply(markup: Markup): Option[isabelle.Timing] =
wenzelm@50201
   290
      markup match {
wenzelm@50781
   291
        case Markup(TIMING, Timing_Properties(timing)) => Some(timing)
wenzelm@50201
   292
        case _ => None
wenzelm@50201
   293
      }
wenzelm@50201
   294
  }
wenzelm@50201
   295
wenzelm@50201
   296
wenzelm@51662
   297
  /* command timing */
wenzelm@51662
   298
wenzelm@51818
   299
  val COMMAND_TIMING = "command_timing"
wenzelm@51662
   300
wenzelm@51662
   301
wenzelm@50201
   302
  /* toplevel */
wenzelm@50201
   303
wenzelm@50201
   304
  val SUBGOALS = "subgoals"
wenzelm@50201
   305
  val PROOF_STATE = "proof_state"
wenzelm@50201
   306
wenzelm@50201
   307
  val STATE = "state"
wenzelm@50543
   308
  val GOAL = "goal"
wenzelm@50201
   309
  val SUBGOAL = "subgoal"
wenzelm@50215
   310
wenzelm@50450
   311
wenzelm@50201
   312
  /* command status */
wenzelm@50201
   313
wenzelm@50201
   314
  val TASK = "task"
wenzelm@50201
   315
wenzelm@50201
   316
  val ACCEPTED = "accepted"
wenzelm@50201
   317
  val FORKED = "forked"
wenzelm@50201
   318
  val JOINED = "joined"
wenzelm@50201
   319
  val RUNNING = "running"
wenzelm@50201
   320
  val FINISHED = "finished"
wenzelm@50201
   321
  val FAILED = "failed"
wenzelm@50201
   322
wenzelm@50201
   323
wenzelm@50201
   324
  /* interactive documents */
wenzelm@50201
   325
wenzelm@50201
   326
  val VERSION = "version"
wenzelm@50201
   327
  val ASSIGN = "assign"
wenzelm@50201
   328
wenzelm@50201
   329
wenzelm@50201
   330
  /* prover process */
wenzelm@50201
   331
wenzelm@50201
   332
  val PROVER_COMMAND = "prover_command"
wenzelm@50201
   333
  val PROVER_ARG = "prover_arg"
wenzelm@50201
   334
wenzelm@50201
   335
wenzelm@50201
   336
  /* messages */
wenzelm@50201
   337
lars@55316
   338
  val SERIAL = "serial"
lars@55316
   339
  val Serial = new Properties.Long(SERIAL)
wenzelm@50201
   340
wenzelm@50201
   341
  val MESSAGE = "message"
wenzelm@50201
   342
wenzelm@50201
   343
  val INIT = "init"
wenzelm@50201
   344
  val STATUS = "status"
wenzelm@50201
   345
  val REPORT = "report"
wenzelm@50500
   346
  val RESULT = "result"
wenzelm@50201
   347
  val WRITELN = "writeln"
wenzelm@50201
   348
  val TRACING = "tracing"
wenzelm@50201
   349
  val WARNING = "warning"
wenzelm@50201
   350
  val ERROR = "error"
wenzelm@50201
   351
  val PROTOCOL = "protocol"
wenzelm@50201
   352
  val SYSTEM = "system"
wenzelm@50201
   353
  val STDOUT = "stdout"
wenzelm@50201
   354
  val STDERR = "stderr"
wenzelm@50201
   355
  val EXIT = "exit"
wenzelm@50201
   356
wenzelm@50201
   357
  val WRITELN_MESSAGE = "writeln_message"
wenzelm@50201
   358
  val TRACING_MESSAGE = "tracing_message"
wenzelm@50201
   359
  val WARNING_MESSAGE = "warning_message"
wenzelm@50201
   360
  val ERROR_MESSAGE = "error_message"
wenzelm@50201
   361
wenzelm@52876
   362
  val messages =
wenzelm@50201
   363
    Map(WRITELN -> WRITELN_MESSAGE, TRACING -> TRACING_MESSAGE,
wenzelm@52876
   364
        WARNING -> WARNING_MESSAGE, ERROR -> ERROR_MESSAGE)
wenzelm@52876
   365
  val message: String => String = messages.withDefault((s: String) => s)
wenzelm@50201
   366
wenzelm@50201
   367
  val Return_Code = new Properties.Int("return_code")
wenzelm@50201
   368
wenzelm@50201
   369
  val LEGACY = "legacy"
wenzelm@50201
   370
wenzelm@50201
   371
  val NO_REPORT = "no_report"
wenzelm@50201
   372
wenzelm@50201
   373
  val BAD = "bad"
wenzelm@50201
   374
wenzelm@50500
   375
  val INTENSIFY = "intensify"
wenzelm@52643
   376
  val INFORMATION = "information"
wenzelm@50500
   377
wenzelm@50500
   378
wenzelm@50500
   379
  /* active areas */
wenzelm@50500
   380
wenzelm@50715
   381
  val BROWSER = "browser"
wenzelm@50500
   382
  val GRAPHVIEW = "graphview"
wenzelm@50500
   383
wenzelm@50500
   384
  val SENDBACK = "sendback"
wenzelm@50500
   385
  val PADDING = "padding"
wenzelm@52697
   386
  val PADDING_LINE = (PADDING, "line")
wenzelm@52697
   387
  val PADDING_COMMAND = (PADDING, "command")
wenzelm@50500
   388
wenzelm@50500
   389
  val DIALOG = "dialog"
wenzelm@50503
   390
  val Result = new Properties.String(RESULT)
wenzelm@50500
   391
wenzelm@50201
   392
wenzelm@50201
   393
  /* protocol message functions */
wenzelm@50201
   394
wenzelm@50201
   395
  val FUNCTION = "function"
wenzelm@50201
   396
  val Function = new Properties.String(FUNCTION)
wenzelm@50201
   397
wenzelm@52563
   398
  val Assign_Update: Properties.T = List((FUNCTION, "assign_update"))
wenzelm@50201
   399
  val Removed_Versions: Properties.T = List((FUNCTION, "removed_versions"))
wenzelm@50201
   400
wenzelm@52111
   401
  object Protocol_Handler
wenzelm@52111
   402
  {
wenzelm@52111
   403
    def unapply(props: Properties.T): Option[(String)] =
wenzelm@52111
   404
      props match {
wenzelm@52111
   405
        case List((FUNCTION, "protocol_handler"), (NAME, name)) => Some(name)
wenzelm@52111
   406
        case _ => None
wenzelm@52111
   407
      }
wenzelm@52111
   408
  }
wenzelm@52111
   409
wenzelm@52111
   410
  val INVOKE_SCALA = "invoke_scala"
wenzelm@50201
   411
  object Invoke_Scala
wenzelm@50201
   412
  {
wenzelm@50201
   413
    def unapply(props: Properties.T): Option[(String, String)] =
wenzelm@50201
   414
      props match {
wenzelm@52111
   415
        case List((FUNCTION, INVOKE_SCALA), (NAME, name), (ID, id)) => Some((name, id))
wenzelm@50201
   416
        case _ => None
wenzelm@50201
   417
      }
wenzelm@50201
   418
  }
wenzelm@52111
   419
wenzelm@52111
   420
  val CANCEL_SCALA = "cancel_scala"
wenzelm@50201
   421
  object Cancel_Scala
wenzelm@50201
   422
  {
wenzelm@50201
   423
    def unapply(props: Properties.T): Option[String] =
wenzelm@50201
   424
      props match {
wenzelm@52111
   425
        case List((FUNCTION, CANCEL_SCALA), (ID, id)) => Some(id)
wenzelm@50201
   426
        case _ => None
wenzelm@50201
   427
      }
wenzelm@50201
   428
  }
wenzelm@50255
   429
wenzelm@50255
   430
  object ML_Statistics
wenzelm@50255
   431
  {
wenzelm@50255
   432
    def unapply(props: Properties.T): Option[Properties.T] =
wenzelm@50255
   433
      props match {
wenzelm@50255
   434
        case (FUNCTION, "ML_statistics") :: stats => Some(stats)
wenzelm@50255
   435
        case _ => None
wenzelm@50255
   436
      }
wenzelm@50255
   437
  }
wenzelm@50975
   438
wenzelm@50975
   439
  object Task_Statistics
wenzelm@50975
   440
  {
wenzelm@50975
   441
    def unapply(props: Properties.T): Option[Properties.T] =
wenzelm@50975
   442
      props match {
wenzelm@50975
   443
        case (FUNCTION, "task_statistics") :: stats => Some(stats)
wenzelm@50975
   444
        case _ => None
wenzelm@50975
   445
      }
wenzelm@50975
   446
  }
lars@55316
   447
wenzelm@56616
   448
  object Loading_Theory
wenzelm@56616
   449
  {
wenzelm@56616
   450
    def unapply(props: Properties.T): Option[String] =
wenzelm@56616
   451
      props match {
wenzelm@56616
   452
        case List((FUNCTION, "loading_theory"), (NAME, name)) => Some(name)
wenzelm@56616
   453
        case _ => None
wenzelm@56616
   454
      }
wenzelm@56616
   455
  }
wenzelm@56616
   456
wenzelm@56616
   457
  object Use_Theories_Result
wenzelm@56616
   458
  {
wenzelm@56616
   459
    def unapply(props: Properties.T): Option[(String, Boolean)] =
wenzelm@56616
   460
      props match {
wenzelm@56616
   461
        case List((FUNCTION, "use_theories_result"),
wenzelm@56616
   462
          ("id", id), ("ok", Properties.Value.Boolean(ok))) => Some((id, ok))
wenzelm@56616
   463
        case _ => None
wenzelm@56616
   464
      }
wenzelm@56616
   465
  }
wenzelm@56616
   466
wenzelm@56864
   467
  val PRINT_OPERATIONS = "print_operations"
wenzelm@56864
   468
wenzelm@55553
   469
lars@55316
   470
  /* simplifier trace */
lars@55316
   471
wenzelm@57594
   472
  val SIMP_TRACE_PANEL = "simp_trace_panel"
lars@55316
   473
wenzelm@55553
   474
  val SIMP_TRACE_LOG = "simp_trace_log"
wenzelm@55553
   475
  val SIMP_TRACE_STEP = "simp_trace_step"
wenzelm@55553
   476
  val SIMP_TRACE_RECURSE = "simp_trace_recurse"
wenzelm@55553
   477
  val SIMP_TRACE_HINT = "simp_trace_hint"
wenzelm@55553
   478
  val SIMP_TRACE_IGNORE = "simp_trace_ignore"
lars@55316
   479
wenzelm@55553
   480
  val SIMP_TRACE_CANCEL = "simp_trace_cancel"
wenzelm@55553
   481
  object Simp_Trace_Cancel
lars@55316
   482
  {
lars@55316
   483
    def unapply(props: Properties.T): Option[Long] =
lars@55316
   484
      props match {
wenzelm@55553
   485
        case (FUNCTION, SIMP_TRACE_CANCEL) :: Serial(i) => Some(i)
lars@55316
   486
        case _ => None
lars@55316
   487
      }
lars@55316
   488
  }
wenzelm@45666
   489
}
wenzelm@43721
   490
wenzelm@43721
   491
wenzelm@45666
   492
sealed case class Markup(name: String, properties: Properties.T)
wenzelm@43748
   493