Test if potential opening or closing delimieter Assumes that there is a "$" at state.src[pos]
187410
function isValidDelim(state, pos) {
	var prevChar, nextChar,
		max = state.posMax,
		can_open = true,
		can_close = true;

	prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
	nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;

	// Check non-whitespace conditions for opening and closing, and
	// check that closing delimeter isn't followed by a number
	if (prevChar === 0x20/* " " */ || prevChar === 0x09/* \t */ ||
			(nextChar >= 0x30/* "0" */ && nextChar <= 0x39/* "9" */)) {
		can_close = false;
	}
	if (nextChar === 0x20/* " " */ || nextChar === 0x09/* \t */) {
		can_open = false;
	}

	return {
		can_open: can_open,
		can_close: can_close
	};
}
57167
def __find_args_separator(self, decl_string, start_pos):
        """"""
        bracket_depth = 0
        for index, ch in enumerate(decl_string[start_pos:]):
            if ch not in (self.__begin, self.__end, self.__separator):
                continue  # I am interested only in < and >
            elif self.__separator == ch:
                if not bracket_depth:
                    return index + start_pos
            elif self.__begin == ch:
                bracket_depth += 1
            elif not bracket_depth:
                return index + start_pos
            else:
                bracket_depth -= 1
        return -1
1090956
function checkUriRawCharacters(i) {
  const start = i;
  let l;

  if (l = checkIdent(i)) i += l;
  else if (l = checkNumber(i)) i += l;
  else {
    switch (tokens[i].type) {
      case TokenType.ExclamationMark:
      case TokenType.NumberSign:
      case TokenType.DollarSign:
      case TokenType.PercentSign:
      case TokenType.Ampersand:
      case TokenType.Asterisk:
      case TokenType.PlusSign:
      case TokenType.Comma:
      case TokenType.HyphenMinus:
      case TokenType.FullStop:
      case TokenType.Solidus:
      case TokenType.Colon:
      case TokenType.Semicolon:
      case TokenType.LessThanSign:
      case TokenType.EqualsSign:
      case TokenType.GreaterThanSign:
      case TokenType.QuotationMark:
      case TokenType.CommercialAt:
      case TokenType.LeftSquareBracket:
      case TokenType.RightSquareBracket:
      case TokenType.CircumflexAccent:
      case TokenType.LowLine:
      case TokenType.LeftCurlyBracket:
      case TokenType.VerticalLine:
      case TokenType.RightCurlyBracket:
      case TokenType.Tilde:
        i += 1;
        break;

      default:
        return 0;
    }
  }

  return i - start;
}
155407
function right(str, pos) {
            if (typeof str === "undefined" || typeof pos === "undefined") return "";
            str = '' + str;
            if (isString(pos)) {
                return str.lastIndexOf(pos) > -1 ? str.substr(str.lastIndexOf(pos) + 1) : "";
            } else if (isNumber(pos)) {
                return str.substr(str.length - pos);
            } else {
                return "";
            }
        }
401710
private int getClosingParenthesisPosition(String text, int opening)
   {
      if (text.charAt(opening) != '(')
      {
         return -1;
      }

      int count = 0;
      for (int i = opening; i < text.length(); i++)
      {
         char c = text.charAt(i);
         switch (c)
         {
            case '(':
            {
               ++count;
               break;
            }

            case ')':
            {
               --count;
               if (count == 0)
               {
                  return i;
               }
               break;
            }
         }
      }

      return -1;
   }
722949
private void scanFractionAndSuffix(int pos) {
        radix = 10;
        scanFraction(pos);
        if (reader.ch == 'f' || reader.ch == 'F') {
            reader.putChar(true);
            tk = TokenKind.FLOATLITERAL;
        } else {
            if (reader.ch == 'd' || reader.ch == 'D') {
                reader.putChar(true);
            }
            tk = TokenKind.DOUBLELITERAL;
        }
    }
212411
public static boolean containsSqlScriptDelimiters(String script, String delim) {
        boolean inLiteral = false;
        char[] content = script.toCharArray();
        for (int i = 0; i < script.length(); i++) {
            if (content[i] == '\'') {
                inLiteral = !inLiteral;
            }
            if (!inLiteral && script.startsWith(delim, i)) {
                return true;
            }
        }
        return false;
    }
966502
function checkSubStr(targetStr, pos, searchStr) {
  if (searchStr === "" || pos < 0 || pos + searchStr.length > targetStr.length) {
    return false;
  }
  return targetStr.substr(pos, searchStr.length) === searchStr;
}
945144
private boolean hasDelimiter(String s1, String s2, String delimiter) {
    return s1.contains(delimiter) && s2.contains(delimiter) && s1.split(delimiter).length == s2.split(delimiter).length;
  }
1241180
function enter(path, state) {
                regex = state.opts.regex;
                if (!regex) {
                    throw new TypeError("A regex option is required.");
                }
                pure = function pure(n) {
                    return (0, _sideEffectsSafe.pureBabylon)(n, state.opts);
                };
            }
875423
def expect_re(regexp, buf, pos):
    """"""
    match = regexp.match(buf, pos)
    if not match:
        return None, len(buf)
    return buf[match.start(1):match.end(1)], match.end(0)
520135
function checkDeclaration1(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkProperty(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkPropertyDelim(i)) i++;
  else return 0;

  if (l = checkValue(i)) return i + l - start;

  if (l = checkS(i)) i += l;

  if (l = checkValue(i)) i += l;
  else return 0;

  return i - start;
}
627436
def expect(p, prefixes, confidential=False):
    """"""
    resp = p.stdout.readline()
    log.debug('%s -> %r', p.args, resp if not confidential else '********')
    for prefix in prefixes:
        if resp.startswith(prefix):
            return resp[len(prefix):]
    raise UnexpectedError(resp)
1149717
@Trivial
    public static boolean isSymbol(String s) {
        if (s.length() > 3 && s.charAt(0) == '$' && s.charAt(1) == '{')
            return true;

        return false;
    }
723299
function checkModuleLicense(folder) {

    var licensePath = folder + "/LICENSE",
        readMePath = folder + "/README.md",
        licenseContent;

    //check for LICENSE File First
    if(fs.existsSync(licensePath)){
        licenseContent = fs.readFileSync(licensePath, "utf-8");
        return { isMIT : isLicense.mit(licenseContent), content : licenseContent };
    }
    //Maybe in the README
    else if(fs.existsSync(readMePath)) {
        licenseContent = fs.readFileSync(readMePath, "utf-8");
        return { isMIT : isLicense.mit(licenseContent), content : "Check the README" };
    }
    else {
        return { isMIT : false, content : "not found" };
    }
}
822835
def l_sa_check(template, literal, is_standalone):
    """"""

    # If there is a newline, or the previous tag was a standalone
    if literal.find('\n') != -1 or is_standalone:
        padding = literal.split('\n')[-1]

        # If all the characters since the last newline are spaces
        if padding.isspace() or padding == '':
            # Then the next tag could be a standalone
            return True
        else:
            # Otherwise it can't be
            return False
1036964
function hasEscapeFirst (data, offset) {
    isBuffer = (!isQuiet && typeof data !== 'string')
    escaped = (this.prev.idx > 0)

    return escaped
      ? ( escapeOffset = offset - escLength, -1 )
      //HACK to bypass the trimLeft/trimRight properties
      : ( this.prev.prev.length = leftLength + 1, atok.offset--, 1 )
  }