Skip to content

Commit

Permalink
Fix invalid xstructural generation for named parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Mar 8, 2024
1 parent fe274dc commit 8dcb216
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@
<c:change date="2023-11-04T00:00:00+00:00" summary="Add parameterValueRequireNow for optional parameters."/>
</c:changes>
</c:release>
<c:release date="2024-01-06T11:43:10+00:00" is-open="false" ticket-system="com.github.io7m.quarrel" version="1.5.0">
<c:release date="2024-01-06T00:00:00+00:00" is-open="false" ticket-system="com.github.io7m.quarrel" version="1.5.0">
<c:changes>
<c:change date="2024-01-06T00:00:00+00:00" summary="Change format of xstructural parameters for better layout."/>
</c:changes>
</c:release>
<c:release date="2024-03-08T13:58:55+00:00" is-open="true" ticket-system="com.github.io7m.quarrel" version="1.6.0">
<c:changes>
<c:change date="2024-03-08T13:58:55+00:00" summary="Fix invalid xstructural generation for named parameters."/>
</c:changes>
</c:release>
</c:releases>
<c:ticket-systems>
<c:ticket-system default="true" id="com.github.io7m.quarrel" url="https://www.github.com/io7m/quarrel/issues/"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ private static void showCommand(

sectionName(context, command, document, root);
sectionDescription(context, command, document, root);

final var named = command.onListNamedParameters();
if (!named.isEmpty()) {
final var e =
(Element) root.appendChild(
document.createElementNS(NS_XI, "xi:include")
);

e.setAttribute("href", context.parameterValue(PARAMETERS_INCLUDE_NAME));
}

sectionExamples(document, root);
}
case "parameters" -> {
Expand Down Expand Up @@ -265,24 +276,6 @@ private static void sectionDescription(
para.appendChild(document.createTextNode("The "));
para.appendChild(term);
para.appendChild(document.createTextNode(" command... "));

final var named = command.onListNamedParameters();
if (!named.isEmpty()) {
final var formal =
(Element) description.appendChild(
document.createElementNS(NS, "FormalItem")
);

formal.setAttribute("title", "Parameters");

final var e =
(Element) description.appendChild(
document.createElementNS(NS_XI, "xi:include")
);

e.setAttribute("href", context.parameterValue(PARAMETERS_INCLUDE_NAME));
formal.appendChild(e);
}
}

private static Element parameterTable(
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<com.io7m.jxtrand.version>1.1.0</com.io7m.jxtrand.version>
<com.io7m.xstructural.version>1.8.0</com.io7m.xstructural.version>
<io7m.api.previousVersion>1.4.0</io7m.api.previousVersion>
<io7m.java.targetJavaVersion>21</io7m.java.targetJavaVersion>
<jqwik.version>1.7.3</jqwik.version>
<junit.version>5.9.3</junit.version>
</properties>
Expand Down

0 comments on commit 8dcb216

Please sign in to comment.