src/Pure/PIDE/markup.ML
author wenzelm
Wed Dec 03 14:04:38 2014 +0100 (2014-12-03 ago)
changeset 59083 88b0b1f28adc
parent 59081 2ceb05ee0331
child 59112 e670969f34df
permissions -rw-r--r--
tuned signature;
     1 (*  Title:      Pure/PIDE/markup.ML
     2     Author:     Makarius
     3 
     4 Quasi-abstract markup elements.
     5 *)
     6 
     7 signature MARKUP =
     8 sig
     9   val parse_bool: string -> bool
    10   val print_bool: bool -> string
    11   val parse_int: string -> int
    12   val print_int: int -> string
    13   val parse_real: string -> real
    14   val print_real: real -> string
    15   type T = string * Properties.T
    16   val empty: T
    17   val is_empty: T -> bool
    18   val properties: Properties.T -> T -> T
    19   val nameN: string
    20   val name: string -> T -> T
    21   val kindN: string
    22   val instanceN: string
    23   val languageN: string
    24   val symbolsN: string
    25   val delimitedN: string
    26   val is_delimited: Properties.T -> bool
    27   val language: {name: string, symbols: bool, antiquotes: bool, delimited: bool} -> T
    28   val language': {name: string, symbols: bool, antiquotes: bool} -> bool -> T
    29   val language_method: T
    30   val language_attribute: T
    31   val language_sort: bool -> T
    32   val language_type: bool -> T
    33   val language_term: bool -> T
    34   val language_prop: bool -> T
    35   val language_ML: bool -> T
    36   val language_SML: bool -> T
    37   val language_document: bool -> T
    38   val language_antiquotation: T
    39   val language_text: bool -> T
    40   val language_rail: T
    41   val language_path: T
    42   val bindingN: string val binding: T
    43   val entityN: string val entity: string -> string -> T
    44   val get_entity_kind: T -> string option
    45   val defN: string
    46   val refN: string
    47   val completionN: string val completion: T
    48   val no_completionN: string val no_completion: T
    49   val lineN: string
    50   val end_lineN: string
    51   val offsetN: string
    52   val end_offsetN: string
    53   val fileN: string
    54   val idN: string
    55   val position_properties': string list
    56   val position_properties: string list
    57   val positionN: string val position: T
    58   val expressionN: string val expression: T
    59   val citationN: string val citation: string -> T
    60   val pathN: string val path: string -> T
    61   val urlN: string val url: string -> T
    62   val indentN: string
    63   val blockN: string val block: int -> T
    64   val widthN: string
    65   val breakN: string val break: int -> T
    66   val fbreakN: string val fbreak: T
    67   val itemN: string val item: T
    68   val wordsN: string val words: T
    69   val hiddenN: string val hidden: T
    70   val system_optionN: string
    71   val theoryN: string
    72   val classN: string
    73   val type_nameN: string
    74   val constantN: string
    75   val fixedN: string val fixed: string -> T
    76   val caseN: string val case_: string -> T
    77   val dynamic_factN: string val dynamic_fact: string -> T
    78   val method_modifierN: string
    79   val tfreeN: string val tfree: T
    80   val tvarN: string val tvar: T
    81   val freeN: string val free: T
    82   val skolemN: string val skolem: T
    83   val boundN: string val bound: T
    84   val varN: string val var: T
    85   val numeralN: string val numeral: T
    86   val literalN: string val literal: T
    87   val delimiterN: string val delimiter: T
    88   val inner_stringN: string val inner_string: T
    89   val inner_cartoucheN: string val inner_cartouche: T
    90   val inner_commentN: string val inner_comment: T
    91   val token_rangeN: string val token_range: T
    92   val sortingN: string val sorting: T
    93   val typingN: string val typing: T
    94   val ML_keyword1N: string val ML_keyword1: T
    95   val ML_keyword2N: string val ML_keyword2: T
    96   val ML_keyword3N: string val ML_keyword3: T
    97   val ML_delimiterN: string val ML_delimiter: T
    98   val ML_tvarN: string val ML_tvar: T
    99   val ML_numeralN: string val ML_numeral: T
   100   val ML_charN: string val ML_char: T
   101   val ML_stringN: string val ML_string: T
   102   val ML_commentN: string val ML_comment: T
   103   val SML_stringN: string val SML_string: T
   104   val SML_commentN: string val SML_comment: T
   105   val ML_defN: string
   106   val ML_openN: string
   107   val ML_structureN: string
   108   val ML_typingN: string val ML_typing: T
   109   val antiquotedN: string val antiquoted: T
   110   val antiquoteN: string val antiquote: T
   111   val ML_antiquotationN: string
   112   val document_antiquotationN: string
   113   val document_antiquotation_optionN: string
   114   val paragraphN: string val paragraph: T
   115   val text_foldN: string val text_fold: T
   116   val commandN: string val command: T
   117   val stringN: string val string: T
   118   val alt_stringN: string val alt_string: T
   119   val verbatimN: string val verbatim: T
   120   val cartoucheN: string val cartouche: T
   121   val commentN: string val comment: T
   122   val tokenN: string val token: bool -> Properties.T -> T
   123   val keyword1N: string val keyword1: T
   124   val keyword2N: string val keyword2: T
   125   val keyword3N: string val keyword3: T
   126   val quasi_keywordN: string val quasi_keyword: T
   127   val improperN: string val improper: T
   128   val operatorN: string val operator: T
   129   val elapsedN: string
   130   val cpuN: string
   131   val gcN: string
   132   val timing_properties: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> Properties.T
   133   val parse_timing_properties: Properties.T -> {elapsed: Time.time, cpu: Time.time, gc: Time.time}
   134   val command_timingN: string
   135   val command_timing_properties:
   136     {file: string, offset: int, name: string} -> Time.time -> Properties.T
   137   val parse_command_timing_properties:
   138     Properties.T -> ({file: string, offset: int, name: string} * Time.time) option
   139   val timingN: string val timing: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> T
   140   val subgoalsN: string
   141   val proof_stateN: string val proof_state: int -> T
   142   val stateN: string val state: T
   143   val goalN: string val goal: T
   144   val subgoalN: string val subgoal: string -> T
   145   val taskN: string
   146   val acceptedN: string val accepted: T
   147   val forkedN: string val forked: T
   148   val joinedN: string val joined: T
   149   val runningN: string val running: T
   150   val finishedN: string val finished: T
   151   val failedN: string val failed: T
   152   val serialN: string
   153   val serial_properties: int -> Properties.T
   154   val exec_idN: string
   155   val initN: string
   156   val statusN: string
   157   val resultN: string
   158   val writelnN: string
   159   val tracingN: string
   160   val warningN: string
   161   val errorN: string
   162   val systemN: string
   163   val protocolN: string
   164   val legacyN: string val legacy: T
   165   val reportN: string val report: T
   166   val no_reportN: string val no_report: T
   167   val badN: string val bad: T
   168   val intensifyN: string val intensify: T
   169   val informationN: string val information: T
   170   val browserN: string
   171   val graphviewN: string
   172   val sendbackN: string
   173   val paddingN: string
   174   val padding_line: Properties.entry
   175   val padding_command: Properties.entry
   176   val dialogN: string val dialog: serial -> string -> T
   177   val functionN: string
   178   val assign_update: Properties.T
   179   val removed_versions: Properties.T
   180   val protocol_handler: string -> Properties.T
   181   val invoke_scala: string -> string -> Properties.T
   182   val cancel_scala: string -> Properties.T
   183   val ML_statistics: Properties.entry
   184   val task_statistics: Properties.entry
   185   val command_timing: Properties.entry
   186   val loading_theory: string -> Properties.T
   187   val dest_loading_theory: Properties.T -> string option
   188   val use_theories_result: string -> bool -> Properties.T
   189   val print_operationsN: string
   190   val print_operations: Properties.T
   191   val simp_trace_panelN: string
   192   val simp_trace_logN: string
   193   val simp_trace_stepN: string
   194   val simp_trace_recurseN: string
   195   val simp_trace_hintN: string
   196   val simp_trace_ignoreN: string
   197   val simp_trace_cancel: serial -> Properties.T
   198   val no_output: Output.output * Output.output
   199   val default_output: T -> Output.output * Output.output
   200   val add_mode: string -> (T -> Output.output * Output.output) -> unit
   201   val output: T -> Output.output * Output.output
   202   val enclose: T -> Output.output -> Output.output
   203   val markup: T -> string -> string
   204   val markup_only: T -> string
   205   val markup_report: string -> string
   206 end;
   207 
   208 structure Markup: MARKUP =
   209 struct
   210 
   211 (** markup elements **)
   212 
   213 (* misc values *)
   214 
   215 fun parse_bool "true" = true
   216   | parse_bool "false" = false
   217   | parse_bool s = raise Fail ("Bad boolean: " ^ quote s);
   218 
   219 val print_bool = Bool.toString;
   220 
   221 fun parse_int s =
   222   let val i = Int.fromString s in
   223     if is_none i orelse String.isPrefix "~" s
   224     then raise Fail ("Bad integer: " ^ quote s)
   225     else the i
   226   end;
   227 
   228 val print_int = signed_string_of_int;
   229 
   230 fun parse_real s =
   231   (case Real.fromString s of
   232     SOME x => x
   233   | NONE => raise Fail ("Bad real: " ^ quote s));
   234 
   235 fun print_real x =
   236   let val s = signed_string_of_real x in
   237     (case space_explode "." s of
   238       [a, b] => if forall_string (fn c => c = "0") b then a else s
   239     | _ => s)
   240   end;
   241 
   242 
   243 (* basic markup *)
   244 
   245 type T = string * Properties.T;
   246 
   247 val empty = ("", []);
   248 
   249 fun is_empty ("", _) = true
   250   | is_empty _ = false;
   251 
   252 
   253 fun properties more_props ((elem, props): T) =
   254   (elem, fold_rev Properties.put more_props props);
   255 
   256 fun markup_elem name = (name, (name, []): T);
   257 fun markup_string name prop = (name, fn s => (name, [(prop, s)]): T);
   258 fun markup_int name prop = (name, fn i => (name, [(prop, print_int i)]): T);
   259 
   260 
   261 (* misc properties *)
   262 
   263 val nameN = "name";
   264 fun name a = properties [(nameN, a)];
   265 
   266 val kindN = "kind";
   267 
   268 val instanceN = "instance";
   269 
   270 
   271 (* embedded languages *)
   272 
   273 val languageN = "language";
   274 val symbolsN = "symbols";
   275 val antiquotesN = "antiquotes";
   276 val delimitedN = "delimited"
   277 
   278 fun is_delimited props =
   279   Properties.get props delimitedN = SOME "true";
   280 
   281 fun language {name, symbols, antiquotes, delimited} =
   282   (languageN,
   283    [(nameN, name),
   284     (symbolsN, print_bool symbols),
   285     (antiquotesN, print_bool antiquotes),
   286     (delimitedN, print_bool delimited)]);
   287 
   288 fun language' {name, symbols, antiquotes} delimited =
   289   language {name = name, symbols = symbols, antiquotes = antiquotes, delimited = delimited};
   290 
   291 val language_method =
   292   language {name = "method", symbols = true, antiquotes = false, delimited = false};
   293 val language_attribute =
   294   language {name = "attribute", symbols = true, antiquotes = false, delimited = false};
   295 val language_sort = language' {name = "sort", symbols = true, antiquotes = false};
   296 val language_type = language' {name = "type", symbols = true, antiquotes = false};
   297 val language_term = language' {name = "term", symbols = true, antiquotes = false};
   298 val language_prop = language' {name = "prop", symbols = true, antiquotes = false};
   299 val language_ML = language' {name = "ML", symbols = false, antiquotes = true};
   300 val language_SML = language' {name = "SML", symbols = false, antiquotes = false};
   301 val language_document = language' {name = "document", symbols = false, antiquotes = true};
   302 val language_antiquotation =
   303   language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true};
   304 val language_text = language' {name = "text", symbols = true, antiquotes = false};
   305 val language_rail = language {name = "rail", symbols = true, antiquotes = true, delimited = true};
   306 val language_path = language {name = "path", symbols = false, antiquotes = false, delimited = true};
   307 
   308 
   309 (* formal entities *)
   310 
   311 val (bindingN, binding) = markup_elem "binding";
   312 
   313 val entityN = "entity";
   314 fun entity kind name = (entityN, [(nameN, name), (kindN, kind)]);
   315 
   316 fun get_entity_kind (name, props) =
   317   if name = entityN then AList.lookup (op =) props kindN
   318   else NONE;
   319 
   320 val defN = "def";
   321 val refN = "ref";
   322 
   323 
   324 (* completion *)
   325 
   326 val (completionN, completion) = markup_elem "completion";
   327 val (no_completionN, no_completion) = markup_elem "no_completion";
   328 
   329 
   330 (* position *)
   331 
   332 val lineN = "line";
   333 val end_lineN = "end_line";
   334 
   335 val offsetN = "offset";
   336 val end_offsetN = "end_offset";
   337 
   338 val fileN = "file";
   339 val idN = "id";
   340 
   341 val position_properties' = [fileN, idN];
   342 val position_properties = [lineN, offsetN, end_offsetN] @ position_properties';
   343 
   344 val (positionN, position) = markup_elem "position";
   345 
   346 
   347 (* expression *)
   348 
   349 val (expressionN, expression) = markup_elem "expression";
   350 
   351 
   352 (* citation *)
   353 
   354 val (citationN, citation) = markup_string "citation" nameN;
   355 
   356 
   357 (* external resources *)
   358 
   359 val (pathN, path) = markup_string "path" nameN;
   360 val (urlN, url) = markup_string "url" nameN;
   361 
   362 
   363 (* pretty printing *)
   364 
   365 val indentN = "indent";
   366 val (blockN, block) = markup_int "block" indentN;
   367 
   368 val widthN = "width";
   369 val (breakN, break) = markup_int "break" widthN;
   370 
   371 val (fbreakN, fbreak) = markup_elem "fbreak";
   372 
   373 val (itemN, item) = markup_elem "item";
   374 
   375 
   376 (* text properties *)
   377 
   378 val (wordsN, words) = markup_elem "words";
   379 
   380 val (hiddenN, hidden) = markup_elem "hidden";
   381 
   382 
   383 (* misc entities *)
   384 
   385 val system_optionN = "system_option";
   386 
   387 val theoryN = "theory";
   388 val classN = "class";
   389 val type_nameN = "type_name";
   390 val constantN = "constant";
   391 
   392 val (fixedN, fixed) = markup_string "fixed" nameN;
   393 val (caseN, case_) = markup_string "case" nameN;
   394 val (dynamic_factN, dynamic_fact) = markup_string "dynamic_fact" nameN;
   395 
   396 val method_modifierN = "method_modifier";
   397 
   398 
   399 (* inner syntax *)
   400 
   401 val (tfreeN, tfree) = markup_elem "tfree";
   402 val (tvarN, tvar) = markup_elem "tvar";
   403 val (freeN, free) = markup_elem "free";
   404 val (skolemN, skolem) = markup_elem "skolem";
   405 val (boundN, bound) = markup_elem "bound";
   406 val (varN, var) = markup_elem "var";
   407 val (numeralN, numeral) = markup_elem "numeral";
   408 val (literalN, literal) = markup_elem "literal";
   409 val (delimiterN, delimiter) = markup_elem "delimiter";
   410 val (inner_stringN, inner_string) = markup_elem "inner_string";
   411 val (inner_cartoucheN, inner_cartouche) = markup_elem "inner_cartouche";
   412 val (inner_commentN, inner_comment) = markup_elem "inner_comment";
   413 
   414 val (token_rangeN, token_range) = markup_elem "token_range";
   415 
   416 val (sortingN, sorting) = markup_elem "sorting";
   417 val (typingN, typing) = markup_elem "typing";
   418 
   419 
   420 (* ML syntax *)
   421 
   422 val (ML_keyword1N, ML_keyword1) = markup_elem "ML_keyword1";
   423 val (ML_keyword2N, ML_keyword2) = markup_elem "ML_keyword2";
   424 val (ML_keyword3N, ML_keyword3) = markup_elem "ML_keyword3";
   425 val (ML_delimiterN, ML_delimiter) = markup_elem "ML_delimiter";
   426 val (ML_tvarN, ML_tvar) = markup_elem "ML_tvar";
   427 val (ML_numeralN, ML_numeral) = markup_elem "ML_numeral";
   428 val (ML_charN, ML_char) = markup_elem "ML_char";
   429 val (ML_stringN, ML_string) = markup_elem "ML_string";
   430 val (ML_commentN, ML_comment) = markup_elem "ML_comment";
   431 val (SML_stringN, SML_string) = markup_elem "SML_string";
   432 val (SML_commentN, SML_comment) = markup_elem "SML_comment";
   433 
   434 val ML_defN = "ML_def";
   435 val ML_openN = "ML_open";
   436 val ML_structureN = "ML_structure";
   437 val (ML_typingN, ML_typing) = markup_elem "ML_typing";
   438 
   439 
   440 (* antiquotations *)
   441 
   442 val (antiquotedN, antiquoted) = markup_elem "antiquoted";
   443 val (antiquoteN, antiquote) = markup_elem "antiquote";
   444 
   445 val ML_antiquotationN = "ML_antiquotation";
   446 val document_antiquotationN = "document_antiquotation";
   447 val document_antiquotation_optionN = "document_antiquotation_option";
   448 
   449 
   450 (* text structure *)
   451 
   452 val (paragraphN, paragraph) = markup_elem "paragraph";
   453 val (text_foldN, text_fold) = markup_elem "text_fold";
   454 
   455 
   456 (* outer syntax *)
   457 
   458 val (commandN, command) = markup_elem "command";
   459 val (keyword1N, keyword1) = markup_elem "keyword1";
   460 val (keyword2N, keyword2) = markup_elem "keyword2";
   461 val (keyword3N, keyword3) = markup_elem "keyword3";
   462 val (quasi_keywordN, quasi_keyword) = markup_elem "quasi_keyword";
   463 val (improperN, improper) = markup_elem "improper";
   464 val (operatorN, operator) = markup_elem "operator";
   465 val (stringN, string) = markup_elem "string";
   466 val (alt_stringN, alt_string) = markup_elem "alt_string";
   467 val (verbatimN, verbatim) = markup_elem "verbatim";
   468 val (cartoucheN, cartouche) = markup_elem "cartouche";
   469 val (commentN, comment) = markup_elem "comment";
   470 
   471 val tokenN = "token";
   472 fun token delimited props = (tokenN, (delimitedN, print_bool delimited) :: props);
   473 
   474 
   475 (* timing *)
   476 
   477 val elapsedN = "elapsed";
   478 val cpuN = "cpu";
   479 val gcN = "gc";
   480 
   481 fun timing_properties {elapsed, cpu, gc} =
   482  [(elapsedN, Time.toString elapsed),
   483   (cpuN, Time.toString cpu),
   484   (gcN, Time.toString gc)];
   485 
   486 fun parse_timing_properties props =
   487  {elapsed = Properties.seconds props elapsedN,
   488   cpu = Properties.seconds props cpuN,
   489   gc = Properties.seconds props gcN};
   490 
   491 val timingN = "timing";
   492 fun timing t = (timingN, timing_properties t);
   493 
   494 
   495 (* command timing *)
   496 
   497 val command_timingN = "command_timing";
   498 
   499 fun command_timing_properties {file, offset, name} elapsed =
   500  [(fileN, file), (offsetN, print_int offset),
   501   (nameN, name), (elapsedN, Time.toString elapsed)];
   502 
   503 fun parse_command_timing_properties props =
   504   (case (Properties.get props fileN, Properties.get props offsetN, Properties.get props nameN) of
   505     (SOME file, SOME offset, SOME name) =>
   506       SOME ({file = file, offset = parse_int offset, name = name},
   507         Properties.seconds props elapsedN)
   508   | _ => NONE);
   509 
   510 
   511 (* toplevel *)
   512 
   513 val subgoalsN = "subgoals";
   514 val (proof_stateN, proof_state) = markup_int "proof_state" subgoalsN;
   515 
   516 val (stateN, state) = markup_elem "state";
   517 val (goalN, goal) = markup_elem "goal";
   518 val (subgoalN, subgoal) = markup_string "subgoal" nameN;
   519 
   520 
   521 (* command status *)
   522 
   523 val taskN = "task";
   524 
   525 val (acceptedN, accepted) = markup_elem "accepted";
   526 val (forkedN, forked) = markup_elem "forked";
   527 val (joinedN, joined) = markup_elem "joined";
   528 val (runningN, running) = markup_elem "running";
   529 val (finishedN, finished) = markup_elem "finished";
   530 val (failedN, failed) = markup_elem "failed";
   531 
   532 
   533 (* messages *)
   534 
   535 val serialN = "serial";
   536 fun serial_properties i = [(serialN, print_int i)];
   537 
   538 val exec_idN = "exec_id";
   539 
   540 val initN = "init";
   541 val statusN = "status";
   542 val resultN = "result";
   543 val writelnN = "writeln";
   544 val tracingN = "tracing";
   545 val warningN = "warning";
   546 val errorN = "error";
   547 val systemN = "system";
   548 val protocolN = "protocol";
   549 
   550 val (legacyN, legacy) = markup_elem "legacy";
   551 
   552 val (reportN, report) = markup_elem "report";
   553 val (no_reportN, no_report) = markup_elem "no_report";
   554 
   555 val (badN, bad) = markup_elem "bad";
   556 
   557 val (intensifyN, intensify) = markup_elem "intensify";
   558 val (informationN, information) = markup_elem "information";
   559 
   560 
   561 (* active areas *)
   562 
   563 val browserN = "browser"
   564 val graphviewN = "graphview";
   565 
   566 val sendbackN = "sendback";
   567 val paddingN = "padding";
   568 val padding_line = (paddingN, "line");
   569 val padding_command = (paddingN, "command");
   570 
   571 val dialogN = "dialog";
   572 fun dialog i result = (dialogN, [(serialN, print_int i), (resultN, result)]);
   573 
   574 
   575 (* protocol message functions *)
   576 
   577 val functionN = "function"
   578 
   579 val assign_update = [(functionN, "assign_update")];
   580 val removed_versions = [(functionN, "removed_versions")];
   581 
   582 fun protocol_handler name = [(functionN, "protocol_handler"), (nameN, name)];
   583 
   584 fun invoke_scala name id = [(functionN, "invoke_scala"), (nameN, name), (idN, id)];
   585 fun cancel_scala id = [(functionN, "cancel_scala"), (idN, id)];
   586 
   587 val ML_statistics = (functionN, "ML_statistics");
   588 
   589 val task_statistics = (functionN, "task_statistics");
   590 
   591 val command_timing = (functionN, "command_timing");
   592 
   593 fun loading_theory name = [("function", "loading_theory"), ("name", name)];
   594 
   595 fun dest_loading_theory [("function", "loading_theory"), ("name", name)] = SOME name
   596   | dest_loading_theory _ = NONE;
   597 
   598 fun use_theories_result id ok =
   599   [("function", "use_theories_result"), ("id", id), ("ok", print_bool ok)];
   600 
   601 val print_operationsN = "print_operations";
   602 val print_operations = [(functionN, print_operationsN)];
   603 
   604 
   605 (* simplifier trace *)
   606 
   607 val simp_trace_panelN = "simp_trace_panel";
   608 
   609 val simp_trace_logN = "simp_trace_log";
   610 val simp_trace_stepN = "simp_trace_step";
   611 val simp_trace_recurseN = "simp_trace_recurse";
   612 val simp_trace_hintN = "simp_trace_hint";
   613 val simp_trace_ignoreN = "simp_trace_ignore";
   614 
   615 fun simp_trace_cancel i = [(functionN, "simp_trace_cancel"), (serialN, print_int i)];
   616 
   617 
   618 
   619 (** print mode operations **)
   620 
   621 val no_output = ("", "");
   622 fun default_output (_: T) = no_output;
   623 
   624 local
   625   val default = {output = default_output};
   626   val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]);
   627 in
   628   fun add_mode name output =
   629     Synchronized.change modes (fn tab =>
   630       (if not (Symtab.defined tab name) then ()
   631        else warning ("Redefining markup mode " ^ quote name);
   632        Symtab.update (name, {output = output}) tab));
   633   fun get_mode () =
   634     the_default default
   635       (Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ()));
   636 end;
   637 
   638 fun output m = if is_empty m then no_output else #output (get_mode ()) m;
   639 
   640 val enclose = output #-> Library.enclose;
   641 
   642 fun markup m =
   643   let val (bg, en) = output m
   644   in Library.enclose (Output.escape bg) (Output.escape en) end;
   645 
   646 fun markup_only m = markup m "";
   647 
   648 fun markup_report "" = ""
   649   | markup_report txt = markup report txt;
   650 
   651 end;