Skip to content

Instantly share code, notes, and snippets.

@zdi-team
Created December 18, 2021 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdi-team/9385cd48678ed113c1bdf13a564255b2 to your computer and use it in GitHub Desktop.
Save zdi-team/9385cd48678ed113c1bdf13a564255b2 to your computer and use it in GitHub Desktop.
if (varValue != null) {
// recursive replace
final int varLen = varValue.length();
buf.replace(startPos, endPos, varValue);
altered = true;
int change = isRecursiveEvaluationAllowed()
? substitute(event, buf, startPos, varLen, priorVariables)
: 0;
change = change + (varLen - (endPos - startPos));
pos += change;
bufEnd += change;
lengthChange += change;
chars = getChars(buf); // in case buffer was altered
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment