author | wenzelm |
Mon, 21 Aug 2023 15:54:08 +0200 | |
changeset 78556 | 20360824863a |
parent 78407 | b262ecc98319 |
child 78559 | 020fecb4da0c |
permissions | -rw-r--r-- |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/System/options.scala |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
3 |
|
51945 | 4 |
System options with external string representation. |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
6 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
8 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
9 |
|
75393 | 10 |
object Options { |
77624 | 11 |
val empty: Options = new Options() |
48421 | 12 |
|
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
13 |
object Spec { |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
14 |
def make(s: String): Spec = |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
15 |
s match { |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
16 |
case Properties.Eq(a, b) => Spec(a, Some(b)) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
17 |
case _ => Spec(s) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
18 |
} |
77628 | 19 |
|
20 |
def ISABELLE_BUILD_OPTIONS: List[Spec] = |
|
21 |
Word.explode(Isabelle_System.getenv("ISABELLE_BUILD_OPTIONS")).map(make) |
|
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
22 |
} |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
23 |
|
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
24 |
sealed case class Spec(name: String, value: Option[String] = None, permissive: Boolean = false) { |
77625 | 25 |
override def toString: String = name + if_proper(value, "=" + value.get) |
26 |
} |
|
48421 | 27 |
|
77623 | 28 |
sealed case class Change(name: String, value: String, unknown: Boolean) { |
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
29 |
def spec: Spec = Spec(name, Some(value)) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
30 |
|
77623 | 31 |
def print_prefs: String = |
32 |
name + " = " + Outer_Syntax.quote_string(value) + |
|
33 |
if_proper(unknown, " (* unknown *)") + "\n" |
|
34 |
} |
|
35 |
||
48421 | 36 |
|
75847 | 37 |
/* typed access */ |
75842 | 38 |
|
75846 | 39 |
abstract class Access[A](val options: Options) { |
75842 | 40 |
def apply(name: String): A |
41 |
def update(name: String, x: A): Options |
|
75847 | 42 |
def change(name: String, f: A => A): Options = update(name, f(apply(name))) |
75842 | 43 |
} |
44 |
||
75847 | 45 |
class Access_Variable[A]( |
46 |
val options: Options_Variable, |
|
47 |
val pure_access: Options => Access[A] |
|
48 |
) { |
|
49 |
def apply(name: String): A = pure_access(options.value)(name) |
|
50 |
def update(name: String, x: A): Unit = |
|
51 |
options.change(options => pure_access(options).update(name, x)) |
|
52 |
def change(name: String, f: A => A): Unit = update(name, f(apply(name))) |
|
75842 | 53 |
} |
54 |
||
55 |
||
48421 | 56 |
/* representation */ |
57 |
||
75393 | 58 |
sealed abstract class Type { |
56599 | 59 |
def print: String = Word.lowercase(toString) |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
60 |
} |
49246 | 61 |
case object Bool extends Type |
62 |
case object Int extends Type |
|
63 |
case object Real extends Type |
|
64 |
case object String extends Type |
|
65 |
case object Unknown extends Type |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
66 |
|
77611 | 67 |
val TAG_CONTENT = "content" // formal theory content |
68 |
val TAG_DOCUMENT = "document" // document preparation |
|
69 |
val TAG_BUILD = "build" // relavant for "isabelle build" |
|
70 |
val TAG_UPDATE = "update" // relevant for "isabelle update" |
|
71 |
val TAG_CONNECTION = "connection" // private information about connections (password etc.) |
|
77612 | 72 |
val TAG_COLOR_DIALOG = "color_dialog" // special color selection dialog |
77603 | 73 |
|
77605 | 74 |
case class Entry( |
56465 | 75 |
public: Boolean, |
76 |
pos: Position.T, |
|
77 |
name: String, |
|
78 |
typ: Type, |
|
79 |
value: String, |
|
80 |
default_value: String, |
|
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
81 |
standard_value: Option[String], |
77603 | 82 |
tags: List[String], |
56465 | 83 |
description: String, |
75393 | 84 |
section: String |
85 |
) { |
|
78556 | 86 |
def spec: Spec = Spec(name, Some(value)) |
87 |
||
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
88 |
private def print_value(x: String): String = if (typ == Options.String) quote(x) else x |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
89 |
private def print_standard: String = |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
90 |
standard_value match { |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
91 |
case None => "" |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
92 |
case Some(s) if s == default_value => " (standard)" |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
93 |
case Some(s) => " (standard " + print_value(s) + ")" |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
94 |
} |
75393 | 95 |
private def print(default: Boolean): String = { |
49289 | 96 |
val x = if (default) default_value else value |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
97 |
"option " + name + " : " + typ.print + " = " + print_value(x) + print_standard + |
77504 | 98 |
if_proper(description, "\n -- " + quote(description)) |
49289 | 99 |
} |
100 |
||
101 |
def print: String = print(false) |
|
102 |
def print_default: String = print(true) |
|
49247 | 103 |
|
75393 | 104 |
def title(strip: String = ""): String = { |
56600 | 105 |
val words = Word.explode('_', name) |
49270 | 106 |
val words1 = |
107 |
words match { |
|
108 |
case word :: rest if word == strip => rest |
|
109 |
case _ => words |
|
110 |
} |
|
71601 | 111 |
Word.implode(words1.map(Word.perhaps_capitalize)) |
49270 | 112 |
} |
76579 | 113 |
def title_jedit: String = title("jedit") |
49270 | 114 |
|
48860 | 115 |
def unknown: Boolean = typ == Unknown |
77603 | 116 |
|
77617 | 117 |
def for_tag(tag: String): Boolean = tags.contains(tag) |
118 |
def for_content: Boolean = for_tag(TAG_CONTENT) |
|
119 |
def for_document: Boolean = for_tag(TAG_DOCUMENT) |
|
120 |
def for_color_dialog: Boolean = for_tag(TAG_COLOR_DIALOG) |
|
121 |
||
122 |
def session_content: Boolean = for_content || for_document |
|
48860 | 123 |
} |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
124 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
125 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
126 |
/* parsing */ |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
127 |
|
49270 | 128 |
private val SECTION = "section" |
52065
78f2475aa126
explicit notion of public options, which are shown in the editor options dialog;
wenzelm
parents:
51945
diff
changeset
|
129 |
private val PUBLIC = "public" |
48795
bece259ee055
clarified format of etc/options: only declarations, not re-definitions;
wenzelm
parents:
48718
diff
changeset
|
130 |
private val OPTION = "option" |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
131 |
private val STANDARD = "standard" |
77603 | 132 |
private val FOR = "for" |
48807 | 133 |
private val OPTIONS = Path.explode("etc/options") |
67845 | 134 |
private val PREFS = Path.explode("$ISABELLE_HOME_USER/etc/preferences") |
48713
de26cf3191a3
more token markers, based on actual outer syntax;
wenzelm
parents:
48693
diff
changeset
|
135 |
|
71601 | 136 |
val options_syntax: Outer_Syntax = |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
137 |
Outer_Syntax.empty + ":" + "=" + "--" + "(" + ")" + |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
138 |
Symbol.comment + Symbol.comment_decoded + |
63441 | 139 |
(SECTION, Keyword.DOCUMENT_HEADING) + |
140 |
(PUBLIC, Keyword.BEFORE_COMMAND) + |
|
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
141 |
(OPTION, Keyword.THY_DECL) + |
77603 | 142 |
STANDARD + FOR |
49270 | 143 |
|
71601 | 144 |
val prefs_syntax: Outer_Syntax = Outer_Syntax.empty + "=" |
78407
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
145 |
val specs_syntax: Outer_Syntax = prefs_syntax + "," |
48713
de26cf3191a3
more token markers, based on actual outer syntax;
wenzelm
parents:
48693
diff
changeset
|
146 |
|
75405 | 147 |
trait Parsers extends Parse.Parsers { |
71601 | 148 |
val option_name: Parser[String] = atom("option name", _.is_name) |
149 |
val option_type: Parser[String] = atom("option type", _.is_name) |
|
150 |
val option_value: Parser[String] = |
|
48807 | 151 |
opt(token("-", tok => tok.is_sym_ident && tok.content == "-")) ~ atom("nat", _.is_nat) ^^ |
152 |
{ case s ~ n => if (s.isDefined) "-" + n else n } | |
|
153 |
atom("option value", tok => tok.is_name || tok.is_float) |
|
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
154 |
val option_standard: Parser[Option[String]] = |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
155 |
$$$("(") ~! $$$(STANDARD) ~ opt(option_value) ~ $$$(")") ^^ { case _ ~ _ ~ a ~ _ => a } |
77603 | 156 |
val option_tag: Parser[String] = atom("option tag", _.is_name) |
157 |
val option_tags: Parser[List[String]] = |
|
158 |
$$$(FOR) ~! rep(option_tag) ^^ { case _ ~ x => x } | success(Nil) |
|
78407
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
159 |
val option_spec: Parser[Spec] = |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
160 |
option_name ~ opt($$$("=") ~! option_value ^^ { case _ ~ x => x }) ^^ |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
161 |
{ case x ~ y => Options.Spec(x, y) } |
62968 | 162 |
} |
48807 | 163 |
|
75405 | 164 |
private object Parsers extends Parsers { |
61579 | 165 |
def comment_marker: Parser[String] = |
166 |
$$$("--") | $$$(Symbol.comment) | $$$(Symbol.comment_decoded) |
|
167 |
||
75393 | 168 |
val option_entry: Parser[Options => Options] = { |
49270 | 169 |
command(SECTION) ~! text ^^ |
49295 | 170 |
{ case _ ~ a => (options: Options) => options.set_section(a) } | |
60133
a90982bbe8b4
clarified keywords for quasi-command spans and Sidekick structure;
wenzelm
parents:
59811
diff
changeset
|
171 |
opt($$$(PUBLIC)) ~ command(OPTION) ~! (position(option_name) ~ $$$(":") ~ option_type ~ |
77603 | 172 |
$$$("=") ~ option_value ~ opt(option_standard) ~ option_tags ~ |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
173 |
(comment_marker ~! text ^^ { case _ ~ x => x } | success(""))) ^^ |
77603 | 174 |
{ case a ~ _ ~ ((b, pos) ~ _ ~ c ~ _ ~ d ~ e ~ f ~ g) => |
175 |
(options: Options) => options.declare(a.isDefined, pos, b, c, d, e, f, g) } |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
176 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
177 |
|
75393 | 178 |
val prefs_entry: Parser[Options => Options] = { |
58908 | 179 |
option_name ~ ($$$("=") ~! option_value) ^^ |
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
180 |
{ case a ~ (_ ~ b) => (options: Options) => |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
181 |
options + Options.Spec(a, Some(b), permissive = true) } |
48807 | 182 |
} |
183 |
||
75393 | 184 |
def parse_file( |
185 |
options: Options, |
|
186 |
file_name: String, |
|
187 |
content: String, |
|
67845 | 188 |
syntax: Outer_Syntax = options_syntax, |
75393 | 189 |
parser: Parser[Options => Options] = option_entry |
190 |
): Options = { |
|
67845 | 191 |
val toks = Token.explode(syntax.keywords, content) |
48807 | 192 |
val ops = |
67845 | 193 |
parse_all(rep(parser), Token.reader(toks, Token.Pos.file(file_name))) match { |
48807 | 194 |
case Success(result, _) => result |
195 |
case bad => error(bad.toString) |
|
196 |
} |
|
73359 | 197 |
try { ops.foldLeft(options.set_section("")) { case (opts, op) => op(opts) } } |
73166 | 198 |
catch { case ERROR(msg) => error(msg + Position.here(Position.File(file_name))) } |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
199 |
} |
67845 | 200 |
|
201 |
def parse_prefs(options: Options, content: String): Options = |
|
69366 | 202 |
parse_file(options, PREFS.file_name, content, syntax = prefs_syntax, parser = prefs_entry) |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
203 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
204 |
|
67845 | 205 |
def read_prefs(file: Path = PREFS): String = |
206 |
if (file.is_file) File.read(file) else "" |
|
64186
49816908ae42
support for separate sub-system options, independent of main Isabelle options;
wenzelm
parents:
64151
diff
changeset
|
207 |
|
78407
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
208 |
def parse_specs(content: String): List[Spec] = { |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
209 |
val parser = Parsers.repsep(Parsers.option_spec, Parsers.$$$(",")) |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
210 |
val reader = Token.reader(Token.explode(specs_syntax.keywords, content), Token.Pos.none) |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
211 |
Parsers.parse_all(parser, reader) match { |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
212 |
case Parsers.Success(result, _) => result |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
213 |
case bad => error(bad.toString) |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
214 |
} |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
215 |
} |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
216 |
|
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
217 |
def inline(content: String): Options = Parsers.parse_file(empty, "inline", content) |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
218 |
|
77628 | 219 |
def init(prefs: String = read_prefs(file = PREFS), specs: List[Spec] = Nil): Options = { |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
220 |
var options = empty |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
221 |
for { |
73815 | 222 |
dir <- Components.directories() |
48548 | 223 |
file = dir + OPTIONS if file.is_file |
75405 | 224 |
} { options = Parsers.parse_file(options, file.implode, File.read(file)) } |
77628 | 225 |
Parsers.parse_prefs(options, prefs) ++ specs |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
226 |
} |
48457 | 227 |
|
77609 | 228 |
def init0(): Options = init(prefs = "") |
229 |
||
48457 | 230 |
|
62832 | 231 |
/* Isabelle tool wrapper */ |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48605
diff
changeset
|
232 |
|
72763 | 233 |
val isabelle_tool = Isabelle_Tool("options", "print Isabelle system options", |
75394 | 234 |
Scala_Project.here, |
235 |
{ args => |
|
236 |
var build_options = false |
|
237 |
var get_option = "" |
|
238 |
var list_options = false |
|
77616 | 239 |
var list_tags = List.empty[String] |
75394 | 240 |
var export_file = "" |
62437 | 241 |
|
75394 | 242 |
val getopts = Getopts(""" |
62437 | 243 |
Usage: isabelle options [OPTIONS] [MORE_OPTIONS ...] |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48605
diff
changeset
|
244 |
|
62437 | 245 |
Options are: |
246 |
-b include $ISABELLE_BUILD_OPTIONS |
|
247 |
-g OPTION get value of OPTION |
|
248 |
-l list options |
|
77616 | 249 |
-t TAGS restrict list to given tags (comma-separated) |
62437 | 250 |
-x FILE export options to FILE in YXML format |
251 |
||
252 |
Report Isabelle system options, augmented by MORE_OPTIONS given as |
|
253 |
arguments NAME=VAL or NAME. |
|
254 |
""", |
|
75394 | 255 |
"b" -> (_ => build_options = true), |
256 |
"g:" -> (arg => get_option = arg), |
|
257 |
"l" -> (_ => list_options = true), |
|
77616 | 258 |
"t:" -> (arg => list_tags = space_explode(',', arg)), |
75394 | 259 |
"x:" -> (arg => export_file = arg)) |
52737
7b396ef36af6
clarified meaning of options for "isabelle options";
wenzelm
parents:
52735
diff
changeset
|
260 |
|
75394 | 261 |
val more_options = getopts(args) |
262 |
if (get_option == "" && !list_options && export_file == "") getopts.usage() |
|
52737
7b396ef36af6
clarified meaning of options for "isabelle options";
wenzelm
parents:
52735
diff
changeset
|
263 |
|
75394 | 264 |
val options = { |
265 |
val options0 = Options.init() |
|
266 |
val options1 = |
|
77628 | 267 |
if (build_options) options0 ++ Options.Spec.ISABELLE_BUILD_OPTIONS else options0 |
75394 | 268 |
more_options.foldLeft(options1)(_ + _) |
269 |
} |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48605
diff
changeset
|
270 |
|
77613 | 271 |
if (get_option != "") { |
75394 | 272 |
Output.writeln(options.check_name(get_option).value, stdout = true) |
77613 | 273 |
} |
62437 | 274 |
|
77613 | 275 |
if (export_file != "") { |
75394 | 276 |
File.write(Path.explode(export_file), YXML.string_of_body(options.encode)) |
77613 | 277 |
} |
62437 | 278 |
|
77613 | 279 |
if (get_option == "" && export_file == "") { |
77616 | 280 |
val filter: Options.Entry => Boolean = |
281 |
if (list_tags.isEmpty) (_ => true) |
|
77617 | 282 |
else opt => list_tags.exists(opt.for_tag) |
77616 | 283 |
Output.writeln(options.print(filter = filter), stdout = true) |
77613 | 284 |
} |
75394 | 285 |
}) |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
286 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
287 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
288 |
|
49270 | 289 |
final class Options private( |
77605 | 290 |
options: Map[String, Options.Entry] = Map.empty, |
75393 | 291 |
val section: String = "" |
292 |
) { |
|
78407
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
293 |
def defined(name: String): Boolean = options.isDefinedAt(name) |
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
294 |
|
77605 | 295 |
def iterator: Iterator[Options.Entry] = options.valuesIterator |
75844
7d27944d7141
clarified signature: avoid public representation;
wenzelm
parents:
75843
diff
changeset
|
296 |
|
77605 | 297 |
override def toString: String = iterator.mkString("Options(", ",", ")") |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
298 |
|
77605 | 299 |
private def print_entry(opt: Options.Entry): String = |
77614 | 300 |
if_proper(opt.public, "public ") + opt.print |
54347 | 301 |
|
77616 | 302 |
def print(filter: Options.Entry => Boolean = _ => true): String = |
303 |
cat_lines(iterator.filter(filter).toList.sortBy(_.name).map(print_entry)) |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48605
diff
changeset
|
304 |
|
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
305 |
def description(name: String): String = check_name(name).description |
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
306 |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
307 |
|
48370 | 308 |
/* check */ |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
309 |
|
77605 | 310 |
def get(name: String): Option[Options.Entry] = options.get(name) |
75844
7d27944d7141
clarified signature: avoid public representation;
wenzelm
parents:
75843
diff
changeset
|
311 |
|
77605 | 312 |
def check_name(name: String): Options.Entry = |
75844
7d27944d7141
clarified signature: avoid public representation;
wenzelm
parents:
75843
diff
changeset
|
313 |
get(name) match { |
48860 | 314 |
case Some(opt) if !opt.unknown => opt |
315 |
case _ => error("Unknown option " + quote(name)) |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
316 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
317 |
|
77605 | 318 |
private def check_type(name: String, typ: Options.Type): Options.Entry = { |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
319 |
val opt = check_name(name) |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
320 |
if (opt.typ == typ) opt |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
321 |
else error("Ill-typed option " + quote(name) + " : " + opt.typ.print + " vs. " + typ.print) |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
322 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
323 |
|
48370 | 324 |
|
325 |
/* basic operations */ |
|
326 |
||
75843 | 327 |
private def put(name: String, typ: Options.Type, value: String): Options = { |
48370 | 328 |
val opt = check_type(name, typ) |
49270 | 329 |
new Options(options + (name -> opt.copy(value = value)), section) |
48370 | 330 |
} |
331 |
||
75393 | 332 |
private def get[A](name: String, typ: Options.Type, parse: String => Option[A]): A = { |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
333 |
val opt = check_type(name, typ) |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
334 |
parse(opt.value) match { |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
335 |
case Some(x) => x |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
336 |
case None => |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
337 |
error("Malformed value for option " + quote(name) + |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
338 |
" : " + typ.print + " =\n" + quote(opt.value)) |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
339 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
340 |
} |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
341 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
342 |
|
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
343 |
/* internal lookup and update */ |
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
344 |
|
75846 | 345 |
val bool: Options.Access[Boolean] = |
346 |
new Options.Access[Boolean](this) { |
|
347 |
def apply(name: String): Boolean = get(name, Options.Bool, Value.Boolean.unapply) |
|
348 |
def update(name: String, x: Boolean): Options = put(name, Options.Bool, Value.Boolean(x)) |
|
349 |
} |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
350 |
|
75846 | 351 |
val int: Options.Access[Int] = |
352 |
new Options.Access[Int](this) { |
|
353 |
def apply(name: String): Int = get(name, Options.Int, Value.Int.unapply) |
|
354 |
def update(name: String, x: Int): Options = put(name, Options.Int, Value.Int(x)) |
|
355 |
} |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
356 |
|
75846 | 357 |
val real: Options.Access[Double] = |
358 |
new Options.Access[Double](this) { |
|
359 |
def apply(name: String): Double = get(name, Options.Real, Value.Double.unapply) |
|
360 |
def update(name: String, x: Double): Options = put(name, Options.Real, Value.Double(x)) |
|
361 |
} |
|
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
362 |
|
75846 | 363 |
val string: Options.Access[String] = |
364 |
new Options.Access[String](this) { |
|
365 |
def apply(name: String): String = get(name, Options.String, Some(_)) |
|
366 |
def update(name: String, x: String): Options = put(name, Options.String, x) |
|
367 |
} |
|
48370 | 368 |
|
69073 | 369 |
def seconds(name: String): Time = Time.seconds(real(name)) |
50207 | 370 |
|
48370 | 371 |
|
48807 | 372 |
/* external updates */ |
48370 | 373 |
|
75393 | 374 |
private def check_value(name: String): Options = { |
48370 | 375 |
val opt = check_name(name) |
376 |
opt.typ match { |
|
377 |
case Options.Bool => bool(name); this |
|
378 |
case Options.Int => int(name); this |
|
379 |
case Options.Real => real(name); this |
|
380 |
case Options.String => string(name); this |
|
48860 | 381 |
case Options.Unknown => this |
48370 | 382 |
} |
383 |
} |
|
384 |
||
56465 | 385 |
def declare( |
386 |
public: Boolean, |
|
387 |
pos: Position.T, |
|
388 |
name: String, |
|
389 |
typ_name: String, |
|
390 |
value: String, |
|
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
391 |
standard: Option[Option[String]], |
77603 | 392 |
tags: List[String], |
75393 | 393 |
description: String |
394 |
): Options = { |
|
75844
7d27944d7141
clarified signature: avoid public representation;
wenzelm
parents:
75843
diff
changeset
|
395 |
get(name) match { |
56465 | 396 |
case Some(other) => |
397 |
error("Duplicate declaration of option " + quote(name) + Position.here(pos) + |
|
398 |
Position.here(other.pos)) |
|
48370 | 399 |
case None => |
400 |
val typ = |
|
401 |
typ_name match { |
|
402 |
case "bool" => Options.Bool |
|
403 |
case "int" => Options.Int |
|
404 |
case "real" => Options.Real |
|
405 |
case "string" => Options.String |
|
56465 | 406 |
case _ => |
407 |
error("Unknown type for option " + quote(name) + " : " + quote(typ_name) + |
|
408 |
Position.here(pos)) |
|
48370 | 409 |
} |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
410 |
val standard_value = |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
411 |
standard match { |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
412 |
case None => None |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
413 |
case Some(_) if typ == Options.Bool => |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
414 |
error("Illegal standard value for option " + quote(name) + " : " + typ_name + |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
415 |
Position.here) |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
416 |
case Some(s) => Some(s.getOrElse(value)) |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
417 |
} |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74144
diff
changeset
|
418 |
val opt = |
77605 | 419 |
Options.Entry( |
77603 | 420 |
public, pos, name, typ, value, value, standard_value, tags, description, section) |
49270 | 421 |
(new Options(options + (name -> opt), section)).check_value(name) |
48370 | 422 |
} |
423 |
} |
|
424 |
||
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
425 |
def + (spec: Options.Spec): Options = { |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
426 |
val name = spec.name |
78407
b262ecc98319
more operations for independent "inline" options;
wenzelm
parents:
77668
diff
changeset
|
427 |
if (spec.permissive && !defined(name)) { |
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
428 |
val value = spec.value.getOrElse("") |
77603 | 429 |
val opt = |
77605 | 430 |
Options.Entry(false, Position.none, name, Options.Unknown, value, value, None, Nil, "", "") |
56465 | 431 |
new Options(options + (name -> opt), section) |
432 |
} |
|
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
433 |
else { |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
434 |
val opt = check_name(name) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
435 |
def put(value: String): Options = |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
436 |
(new Options(options + (name -> opt.copy(value = value)), section)).check_value(name) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
437 |
spec.value orElse opt.standard_value match { |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
438 |
case Some(value) => put(value) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
439 |
case None if opt.typ == Options.Bool => put("true") |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
440 |
case None => error("Missing value for option " + quote(name) + " : " + opt.typ.print) |
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
441 |
} |
48370 | 442 |
} |
443 |
} |
|
444 |
||
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
445 |
def + (s: String): Options = this + Options.Spec.make(s) |
48456
d8ff14f44a40
added ML version of stand-alone options, with XML.encode/decode operations (unidirectional from Scala to ML);
wenzelm
parents:
48421
diff
changeset
|
446 |
|
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
447 |
def ++ (specs: List[Options.Spec]): Options = specs.foldLeft(this)(_ + _) |
48807 | 448 |
|
48456
d8ff14f44a40
added ML version of stand-alone options, with XML.encode/decode operations (unidirectional from Scala to ML);
wenzelm
parents:
48421
diff
changeset
|
449 |
|
49270 | 450 |
/* sections */ |
451 |
||
452 |
def set_section(new_section: String): Options = |
|
453 |
new Options(options, new_section) |
|
454 |
||
77605 | 455 |
def sections: List[(String, List[Options.Entry])] = |
49270 | 456 |
options.groupBy(_._2.section).toList.map({ case (a, opts) => (a, opts.toList.map(_._2)) }) |
457 |
||
458 |
||
48456
d8ff14f44a40
added ML version of stand-alone options, with XML.encode/decode operations (unidirectional from Scala to ML);
wenzelm
parents:
48421
diff
changeset
|
459 |
/* encode */ |
d8ff14f44a40
added ML version of stand-alone options, with XML.encode/decode operations (unidirectional from Scala to ML);
wenzelm
parents:
48421
diff
changeset
|
460 |
|
75393 | 461 |
def encode: XML.Body = { |
48860 | 462 |
val opts = |
56465 | 463 |
for ((_, opt) <- options.toList; if !opt.unknown) |
464 |
yield (opt.pos, (opt.name, (opt.typ.print, opt.value))) |
|
48860 | 465 |
|
56465 | 466 |
import XML.Encode.{string => string_, _} |
467 |
list(pair(properties, pair(string_, pair(string_, string_))))(opts) |
|
48456
d8ff14f44a40
added ML version of stand-alone options, with XML.encode/decode operations (unidirectional from Scala to ML);
wenzelm
parents:
48421
diff
changeset
|
468 |
} |
48807 | 469 |
|
470 |
||
77622
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
471 |
/* changed options */ |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
472 |
|
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
473 |
def changed( |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
474 |
defaults: Options = Options.init0(), |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
475 |
filter: Options.Entry => Boolean = _ => true |
77623 | 476 |
): List[Options.Change] = { |
77622
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
477 |
List.from( |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
478 |
for { |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
479 |
(name, opt2) <- options.iterator |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
480 |
opt1 = defaults.get(name) |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
481 |
if (opt1.isEmpty || opt1.get.value != opt2.value) && filter(opt2) |
77668
5cb7fd36223b
proper sorting of result (amending f458547b4f0f);
wenzelm
parents:
77628
diff
changeset
|
482 |
} yield Options.Change(name, opt2.value, opt1.isEmpty)).sortBy(_.name) |
77622
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
483 |
} |
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
484 |
|
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
485 |
|
77608 | 486 |
/* preferences */ |
48807 | 487 |
|
77603 | 488 |
def make_prefs( |
77609 | 489 |
defaults: Options = Options.init0(), |
77605 | 490 |
filter: Options.Entry => Boolean = _ => true |
77622
f458547b4f0f
clarified signature (again, see also 8c64e51d9dde and 268bf61631ec);
wenzelm
parents:
77621
diff
changeset
|
491 |
): String = changed(defaults = defaults, filter = filter).map(_.print_prefs).mkString |
77374
268bf61631ec
more robust options in "prefs" format: avoid odd control character;
wenzelm
parents:
77366
diff
changeset
|
492 |
|
77609 | 493 |
def save_prefs(file: Path = Options.PREFS, defaults: Options = Options.init0()): Unit = { |
77374
268bf61631ec
more robust options in "prefs" format: avoid odd control character;
wenzelm
parents:
77366
diff
changeset
|
494 |
val prefs = make_prefs(defaults = defaults) |
72375 | 495 |
Isabelle_System.make_directory(file.dir) |
67845 | 496 |
File.write_backup(file, "(* generated by Isabelle " + Date.now() + " *)\n\n" + prefs) |
48807 | 497 |
} |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
diff
changeset
|
498 |
} |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
499 |
|
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
500 |
|
75393 | 501 |
class Options_Variable(init_options: Options) { |
75846 | 502 |
private var _options = init_options |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
503 |
|
75846 | 504 |
def value: Options = synchronized { _options } |
505 |
def change(f: Options => Options): Unit = synchronized { _options = f(_options) } |
|
77626
af8ac22d97f0
clarified signature: more explicit type Options.Spec, which incorporates all variants of Options.+;
wenzelm
parents:
77625
diff
changeset
|
506 |
def += (name: String, x: String): Unit = change(options => options + Options.Spec(name, Some(x))) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
507 |
|
75846 | 508 |
val bool: Options.Access_Variable[Boolean] = |
75847 | 509 |
new Options.Access_Variable[Boolean](this, _.bool) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
510 |
|
75846 | 511 |
val int: Options.Access_Variable[Int] = |
75847 | 512 |
new Options.Access_Variable[Int](this, _.int) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
513 |
|
75846 | 514 |
val real: Options.Access_Variable[Double] = |
75847 | 515 |
new Options.Access_Variable[Double](this, _.real) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
516 |
|
75846 | 517 |
val string: Options.Access_Variable[String] = |
75847 | 518 |
new Options.Access_Variable[String](this, _.string) |
50207 | 519 |
|
69073 | 520 |
def seconds(name: String): Time = value.seconds(name) |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48992
diff
changeset
|
521 |
} |