code: private boolean isVarEscaped(char[] array, int currentIndex)
      {
          int i = currentIndex - 1;
  
          while (i >= 0 && array[i] == '\\') {
              --i;
          }
  
          return (currentIndex - i) % 2 == 0;
      }
docs: Look in previous characters of the array to find if the current var is escaped (like \$var).
  
  @param array the source to parse
  @param currentIndex the current index in the <code>array</code>
  @return the parser context to put some informations