blob: 8560ee0a07247b1eab7b4c7092b23809db645ca4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
|