substepNode.setLineNumber(substepsParent.getSourceLineNumber());
return substepNode;
}
private ParentStep locateSubStepsParent(final PatternMap<ParentStep> subStepsMapLocal, final Step step) {
ParentStep substepsParent = subStepsMapLocal.get(step.getLine(), 0);
// if we're not strict then we can look for other step defs that fit
if (!this.parameters.getSyntax().isStrict() && substepsParent == null) {
final String originalKeyword = step.getKeyword();
for (final String altKeyword : this.parameters.getSyntax().getNonStrictKeywordPrecedence()) {
// don't use the same keyword again
if (altKeyword.compareToIgnoreCase(originalKeyword) != 0) {
final String altLine = step.getLine().replaceFirst(originalKeyword, altKeyword);
substepsParent = subStepsMapLocal.get(altLine, 0);
if (substepsParent != null) {
// do we need to modify the parent ??
substepsParent = substepsParent.cloneWithAltLine(altLine);
break;
}
}
}