Skip to content

Commit

Permalink
try to put tokens where they can be picked up
Browse files Browse the repository at this point in the history
  • Loading branch information
mbdevpl committed Dec 9, 2017
1 parent 9d3f22c commit 9b6ae48
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/fortran/ofp/XMLPrinterBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,13 @@ protected void insertTokens(Element context, int tokenType, String tokenContextN
throw new IllegalArgumentException("two possible targets");
}
*/
if (targetIndex > 0) {
Element beforeTarget = contextNode(target, targetIndex - 1);
if (beforeTarget.getNodeName().equals("body")) {
target = beforeTarget;
targetIndex = contextNodesCount(beforeTarget);
}
}

Element tokenNode = contextOpen(tokenContextName);
setAttribute(tokenTextAttributeName, token.getText());
Expand Down

0 comments on commit 9b6ae48

Please sign in to comment.