Skip to content

Commit

Permalink
warnings for INLINE within SPLIT: fixes source-academy#568
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-henz committed Dec 13, 2021
1 parent e7d9a98 commit 1bf846c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion javascript/parseXmlLatex.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const ignoreTags = new Set([
"SECTIONCONTENT",
"span",
"SPLIT",
"SPLITINLINE",
"PDF_ONLY"
]);

Expand Down Expand Up @@ -91,6 +90,16 @@ const processTextFunctionsDefaultLatex = {
// }
},

SPLITINLINE: (node, writeTo) => {
if (getChildrenByTagName(node, "JAVASCRIPTINLINE")[0]) {
console.error("remove 'INLINE' from tag JAVASCRIPTINLINE");
}
if (getChildrenByTagName(node, "SCHEMEINLINE")[0]) {
console.error("remove 'INLINE' from tag SCHEMEINLINE");
}
recursiveProcessTextLatex(node.firstChild, writeTo);
},

ABOUT: (node, writeTo) => {
writeTo.push("\\chapter*{");
const name = addName(node, writeTo);
Expand Down
4 changes: 2 additions & 2 deletions xml/chapter3/section2/subsection3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ W1(50);
<SPLITINLINE><SCHEME>procedure</SCHEME>
<JAVASCRIPT>function</JAVASCRIPT></SPLITINLINE>
<SPLITINLINE>
<SCHEME>make-withdraw</SCHEME>
<JAVASCRIPTINLINE>make_withdraw</JAVASCRIPTINLINE>
<SCHEME><SCHEMEINLINE>make-withdraw</SCHEMEINLINE></SCHEME>
<JAVASCRIPT><JAVASCRIPTINLINE>make_withdraw</JAVASCRIPTINLINE></JAVASCRIPT>
</SPLITINLINE>
to an argument:
<SNIPPET EVAL="no">
Expand Down
3 changes: 2 additions & 1 deletion xml/chapter4/section3/subsection1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ function an_integer_starting_from(n) {
<SCHEME>procedure
<SCHEMEINLINE>integers-starting-from</SCHEMEINLINE>
</SCHEME>
<JAVASCRIPT>function</JAVASCRIPT>
<JAVASCRIPT>function
<JAVASCRIPTINLINE>integers_starting_from</JAVASCRIPTINLINE>
</JAVASCRIPT>
</SPLITINLINE>
described in section <REF NAME="sec:infinite-streams"/>, but with an
important difference: The stream
Expand Down

0 comments on commit 1bf846c

Please sign in to comment.