MCPcopy Index your code
hub / github.com/apache/tomcat / skipUntilIgnoreEsc

Method skipUntilIgnoreEsc

java/org/apache/jasper/compiler/JspReader.java:429–457  ·  view source on GitHub ↗

Skip until the given string is matched in the stream, but ignoring chars initially escaped by a '\' and any EL expressions. When returned, the context is positioned past the end of the match. @param limit The String to match. @param ignoreEL true if something that looks like EL shou

(String limit, boolean ignoreEL)

Source from the content-addressed store, hash-verified

427 * <strong>null</strong> otherwise.
428 */
429 Mark skipUntilIgnoreEsc(String limit, boolean ignoreEL) {
430 Mark ret = mark();
431 int limlen = limit.length();
432 int ch;
433 int prev = 'x'; // Doesn't matter
434 char firstChar = limit.charAt(0);
435 skip:
436 for (ch = nextChar(ret); ch != -1; prev = ch, ch = nextChar(ret)) {
437 if (ch == '\\' && prev == '\\') {
438 ch = 0; // Double \ is not an escape char anymore
439 } else if (prev == '\\') {
440 continue;
441 } else if (!ignoreEL && (ch == '$' || ch == '#') && peekChar() == '{') {
442 // Move beyond the '{'
443 nextChar();
444 skipELExpression();
445 } else if (ch == firstChar) {
446 for (int i = 1; i < limlen; i++) {
447 if (peekChar() == limit.charAt(i)) {
448 nextChar();
449 } else {
450 continue skip;
451 }
452 }
453 return ret;
454 }
455 }
456 return null;
457 }
458
459 /**
460 * Skip until the given end tag is matched in the stream. When returned, the context is positioned past the end of

Callers 1

parseAttributeValueMethod · 0.80

Calls 6

markMethod · 0.95
nextCharMethod · 0.95
peekCharMethod · 0.95
skipELExpressionMethod · 0.95
lengthMethod · 0.80
charAtMethod · 0.80

Tested by

no test coverage detected