Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-07-12 14:26:30 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2017-07-12 14:32:33 -0400
commit52c1bb5ebe732582606116342730e76aaaba0c55 (patch)
treec20c0102f8f666c5935cbe1a805effa4808a6c52 /doc
parent7472cb882c0b2d13d7d8304b805e0a19c7cc38e4 (diff)
downloadtame-52c1bb5ebe732582606116342730e76aaaba0c55.tar.gz
tame-52c1bb5ebe732582606116342730e76aaaba0c55.tar.bz2
tame-52c1bb5ebe732582606116342730e76aaaba0c55.zip
Properly resolve paths of symbols of imports
This solves a long-standing problem whereby relative paths are not properly resolved, leading to incorrect symbol conflicts when relative paths to the same package vary between two imports. See doc/notes/path-processing for an illustration. * src/current/include/preproc/path.xsl (preproc:resolve-relative-import): Add function. (preproc:resolv-path, preproc:resolve-path, preproc:get-path): Add functions to invoke existing templates. * src/current/include/preproc/symtable.xsl (preproc:symimport): Use `preproc:resolve-relative-import'. * doc/notes/path-processing: Add notes.
Diffstat (limited to 'doc')
-rw-r--r--doc/notes/path-processing65
1 files changed, 65 insertions, 0 deletions
diff --git a/doc/notes/path-processing b/doc/notes/path-processing
new file mode 100644
index 0000000..8560ee0
--- /dev/null
+++ b/doc/notes/path-processing
@@ -0,0 +1,65 @@
+Path processing
+---------------
+Need rules that will work for both the existing scenario (B) and the new
+scenario (A):
+
+
+ _
+ / \
+ / _ \
+ / ___ \
+/_/ \_\
+---------
+
+root = ../
+package = suppliers/colony <--- /suppliers/colony
+import = ../map/return/colony <--- /map/return/colony
+
+mapimport = ../../suppliers/colony/gl <-- /suppliers/colony/gl
+
+
+ this is the root
+ / \
+ v v
+1) <..>/map/return/ | <..>/../suppliers/colony/gl
+ = ../suppliers/colony/gl
+ ^^^^^^^^^^^^^^^^
+ \ /
+ package name
+
+2) strip root||(package base) from package import
+ = ../map/return | <../suppliers/>colony/gl
+ = colony/gl
+ ^^^^^^^^^
+ ` The relative path from package
+
+
+
+ ____
+| __ )
+| _ \
+| |_) |
+|____/
+-------
+
+what about normal includes?
+
+
+root = ../
+package = suppliers/colony <--- /suppliers/colony
+import = ../common/foo <--- /common/foo
+
+subimport = bar/baz <--- /common/foo/bar/baz
+
+
+ one has root, other does not
+ /
+ v
+1) <..>/common/ | bar/baz
+ = ../common/bar/baz
+
+2) strip root||(package base) from package import
+ = ../common/bar/baz
+ ^^^^^^^^^^^^^^^^^
+ ` no such prefix,
+ so this is the relative path