Check whether a given token is trivial or not.
@param {Token} token The token to check.
@returns {boolean} `true` if the token is trivial.
491943
function isTrivialToken (token) {
  return token != null && (
    (token.type === 'Punctuator' && TRIVIAL_PUNCTUATOR.test(token.value)) ||
    token.type === 'HTMLTagOpen' ||
    token.type === 'HTMLEndTagOpen' ||
    token.type === 'HTMLTagClose' ||
    token.type === 'HTMLSelfClosingTagClose'
  )
}
993613
protected function checkToken($token)
    {
        try {
            $response = $this->http->get($this->checkTokenURL(), [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . $token
                ]
            ]);
            $content = json_decode($response->getBody()->getContents());
            if (isset($content->message)) {
                if ($content->message === 'Token is valid') {
                    return true;
                }
            }
        } catch (\Exception $e) {
            return false;
        }
        return false;
    }
745150
private boolean isWord(String token) {
    if (token.length() == 1) {
      char c = token.charAt(0);
      if (!Character.isLetter(c)) {
        return false;
      }
    }
    return true;
  }
917487
function checkAtkeyword(i) {
  let l;

  // Check that token is `@`:
  if (i >= tokensLength ||
      tokens[i++].type !== TokenType.CommercialAt) return 0;

  return (l = checkIdentOrInterpolation(i)) ? l + 1 : 0;
}
165948
function checkEscapedString(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (tokens[i].type === TokenType.Tilde && (l = checkString(i + 1)))
    return i + l - start;
  else return 0;
}
1257360
function isPlural(token){
    var matches = token.match(/^(.*)-(ku|mu|nya|lah|kah|tah|pun)$/);
    if(matches){
        return matches[1].search('-') != -1;
    }
    return token.search('-') != -1;
}
793335
function token(value) {
		if ( !arguments.length ) return cred.token;
		cred.token = (value && value.length > 0 ? value : undefined);
		return that;
	}
42535
function checkIsHttpToken(val) {
  if (typeof val !== 'string' || val.length === 0)
    return false;
  if (!isValidTokenChar(val.charCodeAt(0)))
    return false;
  const len = val.length;
  if (len > 1) {
    if (!isValidTokenChar(val.charCodeAt(1)))
      return false;
    if (len > 2) {
      if (!isValidTokenChar(val.charCodeAt(2)))
        return false;
      if (len > 3) {
        if (!isValidTokenChar(val.charCodeAt(3)))
          return false;
        for (var i = 4; i < len; i++) {
          if (!isValidTokenChar(val.charCodeAt(i)))
            return false;
        }
      }
    }
  }
  return true;
}
87858
function (token) {
        var any = token.peek();
        if (any !== "any")
            throw _cs.exception("validate", "parse error: invalid any type \"" + any + "\"");
        token.skip();
        return { type: "any" };
    }
246778
function (tokens) {
        var token = null;
        for (var i = 0; i < tokens.length; i++) {
            // Find the most specific token.
            if (tokenFromAceToken[tokens[i]] !== undefined) {
                token = tokenFromAceToken[tokens[i]];
            }
        }
        return token;
    }
1119377
private boolean match(JsDocToken token1, JsDocToken token2) {
    unreadToken = next();
    return unreadToken == token1 || unreadToken == token2;
  }
4134
def expect_optional_token(lexer: Lexer, kind: TokenKind) -> Optional[Token]:
    
    token = lexer.token
    if token.kind == kind:
        lexer.advance()
        return token

    return None
702538
function hintable(token) {

        function _isInsideRegExp(token) {
            return token.state && (token.state.lastType === "regexp" ||
                   (token.state.localState && token.state.localState.lastType === "regexp"));
        }

        switch (token.type) {
        case "comment":
        case "number":
        case "regexp":
        case "string":
        case "def":     // exclude variable & param decls
            return false;
        case "string-2":
            // exclude strings inside a regexp
            return !_isInsideRegExp(token);
        default:
            return true;
        }
    }
1293714
static boolean isAssociative(Token type) {
    switch (type) {
      case MUL:
      case AND:
      case OR:
      case BITOR:
      case BITXOR:
      case BITAND:
        return true;
      default:
        return false;
    }
  }
422842
function SemanticChecker(tokens) {
    this._tokens = tokens;
    this._index = -1;
    this._tree = null;
    this._stack = [];
    if (!this.checkExp()) {
        throw [0, "This is not a understandable expression!"];
    }
    if (this.tkn() !== null) {
        throw [this._index, "Unexpected end of expression! Maybe you forgot a \"(\" somewhere."];
    }
}
14242
public static boolean isValid(String token)
    {
        if (token == null || token.length() == 0)
        {
            return false;
        }

        int len = token.length();

        for (int i = 0; i < len; ++i)
        {
            if (isSeparator(token.charAt(i)))
            {
                return false;
            }
        }

        return true;
    }
1272337
function (token) {
        token.consume("(");
        var ast = this.parse_spec(token);
        while (token.peek() === "|") {
            token.consume("|");
            var child = this.parse_spec(token); /*  RECURSION  */
            ast = { type: "or", op1: ast, op2: child };
        }
        token.consume(")");
        return ast;
    }