equal
deleted
inserted
replaced
255 def expand: Path = expand_env(Isabelle_System.settings()) |
255 def expand: Path = expand_env(Isabelle_System.settings()) |
256 |
256 |
257 def file_name: String = expand.base.implode |
257 def file_name: String = expand.base.implode |
258 |
258 |
259 |
259 |
260 /* source position */ |
260 /* implode wrt. given directories */ |
261 |
261 |
262 def position: Position.T = Position.File(implode) |
262 def implode_symbolic: String = |
|
263 { |
|
264 val directories = |
|
265 Library.space_explode(':', Isabelle_System.getenv("ISABELLE_DIRECTORIES")).reverse |
|
266 val full_name = expand.implode |
|
267 directories.view.flatMap(a => |
|
268 try { |
|
269 val b = Path.explode(a).expand.implode |
|
270 if (full_name == b) Some(a) |
|
271 else { |
|
272 Library.try_unprefix(b + "/", full_name) match { |
|
273 case Some(name) => Some(a + "/" + name) |
|
274 case None => None |
|
275 } |
|
276 } |
|
277 } catch { case ERROR(_) => None }).headOption.getOrElse(implode) |
|
278 } |
|
279 |
|
280 def position: Position.T = Position.File(implode_symbolic) |
263 |
281 |
264 |
282 |
265 /* platform files */ |
283 /* platform files */ |
266 |
284 |
267 def file: JFile = File.platform_file(this) |
285 def file: JFile = File.platform_file(this) |