equal
deleted
inserted
replaced
148 jvm_path(expand_path(isabelle_path)) |
148 jvm_path(expand_path(isabelle_path)) |
149 |
149 |
150 def platform_file(path: String) = new File(platform_path(path)) |
150 def platform_file(path: String) = new File(platform_path(path)) |
151 |
151 |
152 |
152 |
|
153 /* try_read */ |
|
154 |
|
155 def try_read(path: String): String = |
|
156 { |
|
157 val file = platform_file(path) |
|
158 if (file.isFile) Source.fromFile(file).mkString else "" |
|
159 } |
|
160 |
|
161 |
153 /* source files */ |
162 /* source files */ |
154 |
163 |
155 private def try_file(file: File) = if (file.isFile) Some(file) else None |
164 private def try_file(file: File) = if (file.isFile) Some(file) else None |
156 |
165 |
157 def source_file(path: String): Option[File] = |
166 def source_file(path: String): Option[File] = |
302 |
311 |
303 |
312 |
304 /* symbols */ |
313 /* symbols */ |
305 |
314 |
306 private def read_symbols(path: String): List[String] = |
315 private def read_symbols(path: String): List[String] = |
307 { |
316 Library.chunks(try_read(path)).map(_.toString).toList |
308 val file = platform_file(path) |
317 |
309 if (file.isFile) Source.fromFile(file).getLines("\n").toList |
|
310 else Nil |
|
311 } |
|
312 val symbols = new Symbol.Interpretation( |
318 val symbols = new Symbol.Interpretation( |
313 read_symbols("$ISABELLE_HOME/etc/symbols") ::: |
319 read_symbols("$ISABELLE_HOME/etc/symbols") ::: |
314 read_symbols("$ISABELLE_HOME_USER/etc/symbols")) |
320 read_symbols("$ISABELLE_HOME_USER/etc/symbols")) |
315 |
321 |
316 |
322 |