src/Pure/PIDE/markup.scala
changeset 68101 0699a0bacc50
parent 68090 7c8ed28dd40a
child 68148 fb661e4c4717
equal deleted inserted replaced
68097:5f3cffe16311 68101:0699a0bacc50
   569   }
   569   }
   570 
   570 
   571   val EXPORT = "export"
   571   val EXPORT = "export"
   572   object Export
   572   object Export
   573   {
   573   {
   574     sealed case class Args(id: Option[String], theory_name: String, name: String, compress: Boolean)
   574     sealed case class Args(
       
   575       id: Option[String], serial: Long, theory_name: String, name: String, compress: Boolean)
   575 
   576 
   576     val THEORY_NAME = "theory_name"
   577     val THEORY_NAME = "theory_name"
   577     val COMPRESS = "compress"
   578     val COMPRESS = "compress"
   578 
   579 
   579     def dest_inline(props: Properties.T): Option[(Args, Bytes)] =
   580     def dest_inline(props: Properties.T): Option[(Args, Bytes)] =
   580       props match {
   581       props match {
   581         case
   582         case
   582           List((THEORY_NAME, theory_name), (NAME, name), (COMPRESS, Value.Boolean(compress)),
   583           List(
   583             (EXPORT, hex)) => Some((Args(None, theory_name, name, compress), Bytes.hex(hex)))
   584             (SERIAL, Value.Long(serial)),
       
   585             (THEORY_NAME, theory_name),
       
   586             (NAME, name),
       
   587             (COMPRESS, Value.Boolean(compress)),
       
   588             (EXPORT, hex)) =>
       
   589           Some((Args(None, serial, theory_name, name, compress), Bytes.hex(hex)))
   584         case _ => None
   590         case _ => None
   585       }
   591       }
   586 
   592 
   587     def unapply(props: Properties.T): Option[Args] =
   593     def unapply(props: Properties.T): Option[Args] =
   588       props match {
   594       props match {
   589         case List((FUNCTION, EXPORT), (ID, id),
   595         case List(
   590           (THEORY_NAME, theory_name), (PATH, name), (COMPRESS, Value.Boolean(compress))) =>
   596             (FUNCTION, EXPORT),
   591             Some(Args(proper_string(id), theory_name, name, compress))
   597             (ID, id),
       
   598             (SERIAL, Value.Long(serial)),
       
   599             (THEORY_NAME, theory_name),
       
   600             (NAME, name),
       
   601             (COMPRESS, Value.Boolean(compress))) =>
       
   602           Some(Args(proper_string(id), serial, theory_name, name, compress))
   592         case _ => None
   603         case _ => None
   593       }
   604       }
   594   }
   605   }
   595 
   606 
   596   val BUILD_SESSION_FINISHED = "build_session_finished"
   607   val BUILD_SESSION_FINISHED = "build_session_finished"