-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tcl: correct namespace resolution in case of INLINE_SOURCES = YES
- Loading branch information
1 parent
06bd53a
commit 4701431
Showing
5 changed files
with
213 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> | ||
<compounddef id="namespacen1" kind="namespace"> | ||
<compoundname>n1</compoundname> | ||
<innernamespace refid="namespacen1_1_1n1">n1::n1</innernamespace> | ||
<sectiondef kind="func"> | ||
<memberdef kind="function" id="namespacen1_1a9f23d7a7f141915457e8e26023d70cb4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n1::p1</definition> | ||
<argsstring>args</argsstring> | ||
<name>p1</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="12" bodyend="16"/> | ||
<references refid="namespacen1_1a0bff29f718fa43e49b7ca79985afb5fa" compoundref="062__namespace__resolution_8tcl" startline="17" endline="20">p2</references> | ||
</memberdef> | ||
<memberdef kind="function" id="namespacen1_1a0bff29f718fa43e49b7ca79985afb5fa" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n1::p2</definition> | ||
<argsstring>args</argsstring> | ||
<name>p2</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="17" bodyend="20"/> | ||
<referencedby refid="namespacen1_1a9f23d7a7f141915457e8e26023d70cb4" compoundref="062__namespace__resolution_8tcl" startline="12" endline="16">p1</referencedby> | ||
</memberdef> | ||
</sectiondef> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<location file="062_namespace_resolution.tcl" line="11" column="1"/> | ||
</compounddef> | ||
</doxygen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> | ||
<compounddef id="namespacen2" kind="namespace"> | ||
<compoundname>n2</compoundname> | ||
<innernamespace refid="namespacen2_1_1n2">n2::n2</innernamespace> | ||
<sectiondef kind="func"> | ||
<memberdef kind="function" id="namespacen2_1a74950c0185232e374220a0707b4903c6" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n2::p1</definition> | ||
<argsstring>args</argsstring> | ||
<name>p1</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="31" bodyend="35"/> | ||
<references refid="namespacen2_1a49fadfbefa795204a3c566ec76ff632f" compoundref="062__namespace__resolution_8tcl" startline="36" endline="39">p2</references> | ||
</memberdef> | ||
<memberdef kind="function" id="namespacen2_1a49fadfbefa795204a3c566ec76ff632f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n2::p2</definition> | ||
<argsstring>args</argsstring> | ||
<name>p2</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="36" bodyend="39"/> | ||
<referencedby refid="namespacen2_1a74950c0185232e374220a0707b4903c6" compoundref="062__namespace__resolution_8tcl" startline="31" endline="35">p1</referencedby> | ||
</memberdef> | ||
</sectiondef> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<location file="062_namespace_resolution.tcl" line="29" column="1"/> | ||
</compounddef> | ||
</doxygen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> | ||
<compounddef id="namespacen3" kind="namespace"> | ||
<compoundname>n3</compoundname> | ||
<innernamespace refid="namespacen3_1_1n3">n3::n3</innernamespace> | ||
<sectiondef kind="func"> | ||
<memberdef kind="function" id="namespacen3_1ae7e87e49507bd56dad087cffecd35b29" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n3::p1</definition> | ||
<argsstring>args</argsstring> | ||
<name>p1</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="47" bodyend="51"/> | ||
<references refid="namespacen3_1a14e9fe1b27a6d36db9ace2eef4509979" compoundref="062__namespace__resolution_8tcl" startline="52" endline="55">p2</references> | ||
</memberdef> | ||
<memberdef kind="function" id="namespacen3_1a14e9fe1b27a6d36db9ace2eef4509979" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> | ||
<type/> | ||
<definition>n3::p2</definition> | ||
<argsstring>args</argsstring> | ||
<name>p2</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="062_namespace_resolution.tcl" bodystart="52" bodyend="55"/> | ||
<referencedby refid="namespacen3_1ae7e87e49507bd56dad087cffecd35b29" compoundref="062__namespace__resolution_8tcl" startline="47" endline="51">p1</referencedby> | ||
</memberdef> | ||
</sectiondef> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<location file="062_namespace_resolution.tcl" line="45" column="1"/> | ||
</compounddef> | ||
</doxygen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#// objective: tests correct namespace resolution, only references/referencedby relations are relevant | ||
#// check: namespacen1.xml | ||
#// check: namespacen2.xml | ||
#// check: namespacen3.xml | ||
#// config: REFERENCED_BY_RELATION = yes | ||
#// config: REFERENCES_RELATION = yes | ||
#// config: EXTRACT_ALL = yes | ||
#// config: INLINE_SOURCES = yes | ||
|
||
# now: combine namespace eval and qualified names | ||
namespace eval n1 { | ||
proc p1 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
p2 | ||
return | ||
} | ||
proc p2 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
namespace eval n1 { | ||
proc p1 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
} | ||
} | ||
# same thing, but fully qualified proc names | ||
namespace eval ::n2 {} | ||
namespace eval ::n2::n2 {} | ||
proc ::n2::p1 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
p2 | ||
return | ||
} | ||
proc ::n2::p2 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
proc ::n2::n2::p2 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
# same thing, without leading :: | ||
namespace eval n3 {} | ||
namespace eval n3::n3 {} | ||
proc n3::p1 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
p2 | ||
return | ||
} | ||
proc n3::p2 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
proc n3::n3::p2 args { | ||
array set info [info frame 0]; puts -nonewline ->$info(proc) | ||
return | ||
} | ||
# now, check with tcl what is called | ||
n1::p1 | ||
puts "" | ||
n2::p1 | ||
puts "" | ||
n3::p1 | ||
puts "" | ||
exit | ||
|