From 6c72b0731f958278a77b01c90a72893272237d3c Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Mon, 18 Sep 2023 14:03:24 +0200 Subject: [PATCH] fixed --- .../Expressions/Values/Location/Location.md | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/courses/Rascal/Expressions/Values/Location/Location.md b/courses/Rascal/Expressions/Values/Location/Location.md index 4f85fa04f..726d7ce23 100644 --- a/courses/Rascal/Expressions/Values/Location/Location.md +++ b/courses/Rascal/Expressions/Values/Location/Location.md @@ -75,27 +75,13 @@ The elements of a location value can be accessed and modified using the standard * `begin.line`, `begin.column`: begin line and column of text area. * `end.line`, `end.column` end line and column of text area. -These are the supported protocol schemes: - -| Scheme name and pattern | Description | -| --- | --- | -| `file:///` | for absolute file names in the OS filesystem | -| `project:///` | relative to an IDEs workspace, the authority part is a project name and `/` is the root of the source project. Only in an IDE context you can find other projects with this. When running standalone on the commandline or using Maven only the current project is resolved. | -| `target:///` | relative to an IDEs workspace, the authority part is a project name, and the `/` is the root of the binary target path. For example Java's `.class` files end up there | -| `tmp:///` | finds the OS's folder for temporary files | -| `home:///` | finds the current user's home folder | -| `cwd:///` | finds the OS's current working directory | -| `std:///` | resolves to the (installed) location of the Rascal standard library | -| `zip+:///!/:///!//` | resolves to the an Eclipse plugin (extracted) resource location, it resolves via an OSGI `bundleresource://` | -| `bundleresource:///` | resolves to the an OSGI bundle (extracted) resource location. This resolves to a `jar+file://!/` often but could also resolve to a filesystem location depending on the configuration options of the bundle. | - -Locations with specific position information should always be generated automatically but for the curious here is an example: +All the supported schemes are reported [here]((Locations)) + +Locations with specific position information are normally generated automatically (e.g. by parsers) but for the curious here is an example: ```rascal-shell |file:///home/paulk/pico.trm|(0,1,<2,3>,<4,5>) ``` -Note that this is equivalent to using the `home` scheme: +Note that example is equivalent to using the `home` scheme: ```rascal-shell |home://pico.trm|(0,1,<2,3>,<4,5>) ``` @@ -113,8 +99,10 @@ x = |tmp://myTempDirectory|; x += "myTempFile.txt"; ``` - #### Benefits +* locations are values, but they can be interpreted as references. + #### Pitfalls +* if a location naming scheme is not _unique_ (read inaccurate) then downstream analyses are similarly inaccurate.