Re-order graph:dep-lookup arguments to favor partial application
* src/graph.xsl (graph:dep-lookup): Re-order arguments * test/graph.xspec: Updated accordinglymaster
parent
e5da6f8ce1
commit
b2d87c5318
|
@ -223,11 +223,13 @@
|
|||
|
||||
From a graph perspective,
|
||||
the dependencies are edges on the @var{$symbol} vertex.
|
||||
|
||||
Parameters are organized for partial application.
|
||||
-->
|
||||
<function name="graph:dep-lookup" as="element( preproc:sym-dep )?">
|
||||
<param name="symbol" as="element( preproc:sym )" />
|
||||
<param name="graph" as="element( preproc:sym-deps )" />
|
||||
<param name="lookup" />
|
||||
<param name="graph" as="element( preproc:sym-deps )" />
|
||||
<param name="symbol" as="element( preproc:sym )" />
|
||||
|
||||
<variable name="deps" as="element( preproc:sym-dep )?"
|
||||
select="$graph/preproc:sym-dep
|
||||
|
@ -236,9 +238,9 @@
|
|||
<sequence select="if ( exists( $deps ) ) then
|
||||
$deps
|
||||
else if ( $lookup ) then
|
||||
graph:dep-lookup( $symbol,
|
||||
graph:dep-lookup( $lookup,
|
||||
f:apply( $lookup, $symbol ),
|
||||
$lookup )
|
||||
$symbol )
|
||||
else
|
||||
()" />
|
||||
</function>
|
||||
|
|
|
@ -192,13 +192,14 @@
|
|||
<scenario label="in the same package">
|
||||
<scenario label="where dependencies exist">
|
||||
<call function="graph:dep-lookup">
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='local' ]" />
|
||||
<param name="lookup" select="()" />
|
||||
|
||||
<param name="graph"
|
||||
select="$foo:document/preproc:sym-deps" />
|
||||
|
||||
<param name="lookup" select="()" />
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='local' ]" />
|
||||
</call>
|
||||
|
||||
<expect label="returns local dependencies"
|
||||
|
@ -210,13 +211,14 @@
|
|||
|
||||
<scenario label="with external @src but local deps">
|
||||
<call function="graph:dep-lookup">
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='external-but-not' ]" />
|
||||
<param name="lookup" select="()" />
|
||||
|
||||
<param name="graph"
|
||||
select="$foo:document/preproc:sym-deps" />
|
||||
|
||||
<param name="lookup" select="()" />
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='external-but-not' ]" />
|
||||
</call>
|
||||
|
||||
<expect label="returns local dependencies"
|
||||
|
@ -228,13 +230,15 @@
|
|||
|
||||
<scenario label="where dependencies are missing">
|
||||
<call function="graph:dep-lookup">
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='missing-deps' ]" />
|
||||
<param name="lookup" select="()" />
|
||||
|
||||
<param name="graph"
|
||||
select="$foo:document/preproc:sym-deps" />
|
||||
|
||||
<param name="lookup" select="()" />
|
||||
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='missing-deps' ]" />
|
||||
</call>
|
||||
|
||||
<expect label="return empty sequence"
|
||||
|
@ -250,14 +254,15 @@
|
|||
|
||||
<scenario label="where dependencies exist">
|
||||
<call function="graph:dep-lookup">
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='external' ]" />
|
||||
<param name="lookup"
|
||||
select="foo:lookup( $foo:expected-lookup )" />
|
||||
|
||||
<param name="graph"
|
||||
select="$foo:document/preproc:sym-deps" />
|
||||
|
||||
<param name="lookup"
|
||||
select="foo:lookup( $foo:expected-lookup )" />
|
||||
<param name="symbol"
|
||||
select="$foo:document/preproc:symtable
|
||||
/preproc:sym[ @name='external' ]" />
|
||||
</call>
|
||||
|
||||
<expect label="returns external dependenices"
|
||||
|
|
Loading…
Reference in New Issue