private static final Pattern PATH_ABS = Pattern.compile("/[^/].*");
@RegEx
private static final String YANG_XPATH_FUNCTIONS_STRING =
- "(re-match|deref|derived-from(-or-self)?|enum-value|bit-is-set)(\\()";
+ "(re-match|deref|derived-from(-or-self)?|enum-value|bit-is-set)([ \t\r\n]*)(\\()";
private static final Pattern YANG_XPATH_FUNCTIONS_PATTERN = Pattern.compile(YANG_XPATH_FUNCTIONS_STRING);
private static final Pattern ESCAPED_DQUOT = Pattern.compile("\\\"", Pattern.LITERAL);
private static final Pattern ESCAPED_BACKSLASH = Pattern.compile("\\\\", Pattern.LITERAL);
final String argumentValue) {
final Set<SchemaNodeIdentifier.Relative> uniqueConstraintNodes = new HashSet<>();
for (final String uniqueArgToken : SPACE_SPLITTER.split(argumentValue)) {
- final SchemaNodeIdentifier nodeIdentifier = Utils.nodeIdentifierFromPath(ctx, uniqueArgToken);
+ final SchemaNodeIdentifier nodeIdentifier = nodeIdentifierFromPath(ctx, uniqueArgToken);
SourceException.throwIf(nodeIdentifier.isAbsolute(), ctx.getStatementSourceReference(),
"Unique statement argument '%s' contains schema node identifier '%s' "
+ "which is not in the descendant node identifier form.", argumentValue, uniqueArgToken);
}
@SuppressWarnings("checkstyle:illegalCatch")
- static SchemaNodeIdentifier nodeIdentifierFromPath(final StmtContext<?, ?, ?> ctx, final String path) {
+ public static SchemaNodeIdentifier nodeIdentifierFromPath(final StmtContext<?, ?, ?> ctx, final String path) {
// FIXME: is the path trimming really necessary??
final List<QName> qNames = new ArrayList<>();
for (final String nodeName : SLASH_SPLITTER.split(trimSingleLastSlashFromXPath(path))) {