equal
deleted
inserted
replaced
5 */ |
5 */ |
6 |
6 |
7 package isabelle |
7 package isabelle |
8 |
8 |
9 |
9 |
10 object Protocol_Message |
10 object Protocol_Message { |
11 { |
|
12 /* message markers */ |
11 /* message markers */ |
13 |
12 |
14 object Marker |
13 object Marker { |
15 { |
|
16 def apply(a: String): Marker = |
14 def apply(a: String): Marker = |
17 new Marker { override def name: String = a } |
15 new Marker { override def name: String = a } |
18 |
16 |
19 def test(line: String): Boolean = line.startsWith("\f") |
17 def test(line: String): Boolean = line.startsWith("\f") |
20 } |
18 } |
21 |
19 |
22 abstract class Marker private |
20 abstract class Marker private { |
23 { |
|
24 def name: String |
21 def name: String |
25 val prefix: String = "\f" + name + " = " |
22 val prefix: String = "\f" + name + " = " |
26 |
23 |
27 def apply(text: String): String = prefix + Library.encode_lines(text) |
24 def apply(text: String): String = prefix + Library.encode_lines(text) |
28 def apply(props: Properties.T): String = apply(YXML.string_of_body(XML.Encode.properties(props))) |
25 def apply(props: Properties.T): String = apply(YXML.string_of_body(XML.Encode.properties(props))) |