author | wenzelm |
Sat, 13 Nov 2021 16:43:04 +0100 | |
changeset 74777 | 2fd0c33fe440 |
parent 74748 | 95643a0bff49 |
child 74783 | 47f565849e71 |
permissions | -rw-r--r-- |
67172 | 1 |
/* Title: Pure/Thy/latex.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Support for LaTeX. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
67173 | 10 |
import java.io.{File => JFile} |
11 |
||
67172 | 12 |
import scala.annotation.tailrec |
74748 | 13 |
import scala.collection.mutable |
71601 | 14 |
import scala.util.matching.Regex |
67172 | 15 |
|
16 |
||
17 |
object Latex |
|
18 |
{ |
|
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
19 |
/* output text and positions */ |
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
20 |
|
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
21 |
type Text = XML.Body |
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
22 |
|
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
23 |
def position(a: String, b: String): String = "%:%" + a + "=" + b + "%:%\n" |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
24 |
|
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
25 |
def init_position(file_pos: String): List[String] = |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
26 |
if (file_pos.isEmpty) Nil |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
27 |
else List("\\endinput\n", position(Markup.FILE, file_pos)) |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
28 |
|
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
29 |
class Output |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
30 |
{ |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
31 |
def apply(latex_text: Text, file_pos: String = ""): String = |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
32 |
{ |
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
33 |
var line = 1 |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
34 |
val result = new mutable.ListBuffer[String] |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
35 |
val positions = new mutable.ListBuffer[String] ++= init_position(file_pos) |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
36 |
|
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
37 |
def traverse(body: XML.Body): Unit = |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
38 |
{ |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
39 |
body.foreach { |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
40 |
case XML.Wrapped_Elem(_, _, _) => |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
41 |
case XML.Elem(markup, body) => |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
42 |
if (markup.name == Markup.DOCUMENT_LATEX) { |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
43 |
for { l <- Position.Line.unapply(markup.properties) if positions.nonEmpty } { |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
44 |
val s = position(Value.Int(line), Value.Int(l)) |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
45 |
if (positions.last != s) positions += s |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
46 |
} |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
47 |
traverse(body) |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
48 |
} |
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
49 |
case XML.Text(s) => |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
50 |
line += s.count(_ == '\n') |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
51 |
result += s |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
52 |
} |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
53 |
} |
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
54 |
traverse(latex_text) |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
55 |
|
74777
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
56 |
result ++= positions |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
57 |
result.mkString |
2fd0c33fe440
clarified signature: Latex.Output as parameter to Document_Build.Engine;
wenzelm
parents:
74748
diff
changeset
|
58 |
} |
73780
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
59 |
} |
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
60 |
|
466fae6bf22e
compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents:
73736
diff
changeset
|
61 |
|
67173 | 62 |
/* generated .tex file */ |
63 |
||
67184 | 64 |
private val File_Pattern = """^%:%file=(.+)%:%$""".r |
67194
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
65 |
private val Line_Pattern = """^*%:%(\d+)=(\d+)%:%$""".r |
67173 | 66 |
|
67 |
def read_tex_file(tex_file: Path): Tex_File = |
|
67194
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
68 |
{ |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
69 |
val positions = |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
70 |
Line.logical_lines(File.read(tex_file)).reverse. |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
71 |
takeWhile(_ != "\\endinput").reverse |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
72 |
|
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
73 |
val source_file = |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
74 |
positions match { |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
75 |
case File_Pattern(file) :: _ => Some(file) |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
76 |
case _ => None |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
77 |
} |
67173 | 78 |
|
67194
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
79 |
val source_lines = |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
80 |
if (source_file.isEmpty) Nil |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
81 |
else |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
82 |
positions.flatMap(line => |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
83 |
line match { |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
84 |
case Line_Pattern(Value.Int(line), Value.Int(source_line)) => Some(line -> source_line) |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
85 |
case _ => None |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
86 |
}) |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
87 |
|
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
88 |
new Tex_File(tex_file, source_file, source_lines) |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
89 |
} |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
90 |
|
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
91 |
final class Tex_File private[Latex]( |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
92 |
tex_file: Path, source_file: Option[String], source_lines: List[(Int, Int)]) |
67173 | 93 |
{ |
94 |
override def toString: String = tex_file.toString |
|
95 |
||
67194
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
96 |
def source_position(l: Int): Option[Position.T] = |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
97 |
source_file match { |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
98 |
case None => None |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
99 |
case Some(file) => |
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
100 |
val source_line = |
73359 | 101 |
source_lines.iterator.takeWhile({ case (m, _) => m <= l }). |
102 |
foldLeft(0) { case (_, (_, n)) => n } |
|
67194
1c0a6a957114
positions as postlude: avoid intrusion of odd %-forms into main tex source;
wenzelm
parents:
67190
diff
changeset
|
103 |
if (source_line == 0) None else Some(Position.Line_File(source_line, file)) |
67173 | 104 |
} |
105 |
||
106 |
def position(line: Int): Position.T = |
|
67188
bc7a6455e12a
simplified positions -- line is also human-readable in generated .tex file;
wenzelm
parents:
67184
diff
changeset
|
107 |
source_position(line) getOrElse Position.Line_File(line, tex_file.implode) |
67173 | 108 |
} |
109 |
||
110 |
||
111 |
/* latex log */ |
|
112 |
||
73782 | 113 |
def latex_errors(dir: Path, root_name: String): List[String] = |
114 |
{ |
|
115 |
val root_log_path = dir + Path.explode(root_name).ext("log") |
|
116 |
if (root_log_path.is_file) { |
|
117 |
for { (msg, pos) <- filter_errors(dir, File.read(root_log_path)) } |
|
118 |
yield "Latex error" + Position.here(pos) + ":\n" + Library.indent_lines(2, msg) |
|
119 |
} |
|
120 |
else Nil |
|
121 |
} |
|
122 |
||
67173 | 123 |
def filter_errors(dir: Path, root_log: String): List[(String, Position.T)] = |
67172 | 124 |
{ |
67173 | 125 |
val seen_files = Synchronized(Map.empty[JFile, Tex_File]) |
126 |
||
127 |
def check_tex_file(path: Path): Option[Tex_File] = |
|
128 |
seen_files.change_result(seen => |
|
129 |
seen.get(path.file) match { |
|
130 |
case None => |
|
131 |
if (path.is_file) { |
|
132 |
val tex_file = read_tex_file(path) |
|
133 |
(Some(tex_file), seen + (path.file -> tex_file)) |
|
134 |
} |
|
135 |
else (None, seen) |
|
136 |
case some => (some, seen) |
|
137 |
}) |
|
138 |
||
139 |
def tex_file_position(path: Path, line: Int): Position.T = |
|
140 |
check_tex_file(path) match { |
|
141 |
case Some(tex_file) => tex_file.position(line) |
|
142 |
case None => Position.Line_File(line, path.implode) |
|
143 |
} |
|
144 |
||
67172 | 145 |
object File_Line_Error |
146 |
{ |
|
71601 | 147 |
val Pattern: Regex = """^(.*?\.\w\w\w):(\d+): (.*)$""".r |
67173 | 148 |
def unapply(line: String): Option[(Path, Int, String)] = |
67172 | 149 |
line match { |
150 |
case Pattern(file, Value.Int(line), message) => |
|
151 |
val path = File.standard_path(file) |
|
152 |
if (Path.is_wellformed(path)) { |
|
67183 | 153 |
val file = (dir + Path.explode(path)).canonical |
67423 | 154 |
val msg = Library.perhaps_unprefix("LaTeX Error: ", message) |
155 |
if (file.is_file) Some((file, line, msg)) else None |
|
67172 | 156 |
} |
157 |
else None |
|
158 |
case _ => None |
|
159 |
} |
|
160 |
} |
|
161 |
||
67418
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
162 |
val Line_Error = """^l\.\d+ (.*)$""".r |
67196
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
163 |
val More_Error = |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
164 |
List( |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
165 |
"<argument>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
166 |
"<template>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
167 |
"<recently read>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
168 |
"<to be read again>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
169 |
"<inserted text>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
170 |
"<output>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
171 |
"<everypar>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
172 |
"<everymath>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
173 |
"<everydisplay>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
174 |
"<everyhbox>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
175 |
"<everyvbox>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
176 |
"<everyjob>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
177 |
"<everycr>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
178 |
"<mark>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
179 |
"<everyeof>", |
eb29f4868d14
more error information according to @<Print type of token list@> in pdfweb.tex;
wenzelm
parents:
67194
diff
changeset
|
180 |
"<write>").mkString("^(?:", "|", ") (.*)$").r |
67172 | 181 |
|
73474
4e12a6caefb3
turn LaTeX warning into error, for the sake of isabelle.sty/bbbfont;
wenzelm
parents:
73359
diff
changeset
|
182 |
val Bad_Font = """^LaTeX Font Warning: (Font .*\btxmia\b.* undefined).*$""".r |
67483
aae933ca6fbd
tuned message: same error may occur in different contexts;
wenzelm
parents:
67482
diff
changeset
|
183 |
val Bad_File = """^! LaTeX Error: (File `.*' not found\.)$""".r |
67482 | 184 |
|
67423 | 185 |
val error_ignore = |
186 |
Set( |
|
187 |
"See the LaTeX manual or LaTeX Companion for explanation.", |
|
188 |
"Type H <return> for immediate help.") |
|
189 |
||
67418
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
190 |
def error_suffix1(lines: List[String]): Option[String] = |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
191 |
{ |
71784 | 192 |
val lines1 = |
193 |
lines.take(20).takeWhile({ case File_Line_Error((_, _, _)) => false case _ => true }) |
|
67418
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
194 |
lines1.zipWithIndex.collectFirst({ |
67423 | 195 |
case (Line_Error(msg), i) => |
196 |
cat_lines(lines1.take(i).filterNot(error_ignore) ::: List(msg)) }) |
|
67418
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
197 |
} |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
198 |
def error_suffix2(lines: List[String]): Option[String] = |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
199 |
lines match { |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
200 |
case More_Error(msg) :: _ => Some(msg) |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
201 |
case _ => None |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
202 |
} |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
203 |
|
67173 | 204 |
@tailrec def filter(lines: List[String], result: List[(String, Position.T)]) |
205 |
: List[(String, Position.T)] = |
|
206 |
{ |
|
67172 | 207 |
lines match { |
67173 | 208 |
case File_Line_Error((file, line, msg1)) :: rest1 => |
67183 | 209 |
val pos = tex_file_position(file, line) |
67418
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
210 |
val msg2 = error_suffix1(rest1) orElse error_suffix2(rest1) getOrElse "" |
5a6ed2e679fb
more general error suffixes, e.g. for messages that are broken over several lines;
wenzelm
parents:
67417
diff
changeset
|
211 |
filter(rest1, (Exn.cat_message(msg1, msg2), pos) :: result) |
73474
4e12a6caefb3
turn LaTeX warning into error, for the sake of isabelle.sty/bbbfont;
wenzelm
parents:
73359
diff
changeset
|
212 |
case Bad_Font(msg) :: rest => |
4e12a6caefb3
turn LaTeX warning into error, for the sake of isabelle.sty/bbbfont;
wenzelm
parents:
73359
diff
changeset
|
213 |
filter(rest, (msg, Position.none) :: result) |
67483
aae933ca6fbd
tuned message: same error may occur in different contexts;
wenzelm
parents:
67482
diff
changeset
|
214 |
case Bad_File(msg) :: rest => |
67482 | 215 |
filter(rest, (msg, Position.none) :: result) |
67172 | 216 |
case _ :: rest => filter(rest, result) |
217 |
case Nil => result.reverse |
|
218 |
} |
|
67173 | 219 |
} |
67172 | 220 |
|
67174 | 221 |
filter(Line.logical_lines(root_log), Nil) |
67173 | 222 |
} |
67172 | 223 |
} |