Lines Matching defs:token

19 #include "src/parsing/token.h"
248 for (TokenDesc& desc : token_storage_) desc.token = Token::ILLEGAL;
283 // Returns the next token and advances input.
285 // Returns the token following peek()
287 // Returns the current token again.
288 Token::Value current_token() const { return current().token; }
290 // Returns the location information for the current token
291 // (the token last returned by Next()).
317 // Similar functions for the upcoming token.
319 // One token look-ahead (past the token returned by Next()).
320 Token::Value peek() const { return next().token; }
345 inline bool CurrentMatches(Token::Value token) const {
346 DCHECK(Token::IsKeyword(token));
347 return current().token == token;
353 // The length of the token is used to make sure the literal equals without
391 // Returns true if there was a line terminator before the peek'ed token,
403 // Scans the input as a regular expression pattern, next token must be /(=).
411 DCHECK_EQ(next().token, Token::RBRACE);
431 // The current and look-ahead token.
436 Token::Value token = Token::UNINITIALIZED;
444 return token == Token::PRIVATE_NAME || token == Token::ILLEGAL ||
445 token == Token::ESCAPED_KEYWORD || token == Token::UNINITIALIZED ||
446 token == Token::REGEXP_LITERAL ||
447 base::IsInRange(token, Token::NUMBER, Token::STRING) ||
448 Token::IsAnyIdentifier(token) || Token::IsKeyword(token) ||
449 base::IsInRange(token, Token::TEMPLATE_SPAN, Token::TEMPLATE_TAIL);
452 return token == Token::ILLEGAL || token == Token::UNINITIALIZED ||
453 base::IsInRange(token, Token::TEMPLATE_SPAN, Token::TEMPLATE_TAIL);
508 // Seek to the next_ token at the given position.
578 // Returns the literal string, if any, for the current token (the
579 // token last returned by Next()). The string is 0-terminated.
589 // token as a one-byte literal. E.g. Token::FUNCTION pretends to have a
592 DCHECK(current().CanAccessLiteral() || Token::IsKeyword(current().token) ||
593 current().token == Token::ESCAPED_KEYWORD);
597 DCHECK(current().CanAccessLiteral() || Token::IsKeyword(current().token) ||
598 current().token == Token::ESCAPED_KEYWORD);
602 DCHECK(current().CanAccessLiteral() || Token::IsKeyword(current().token) ||
603 current().token == Token::ESCAPED_KEYWORD);
606 // Returns the literal string for the next token (the token that
641 // Scans a single JavaScript token.
700 static bool LiteralContainsEscapes(const TokenDesc& token) {
701 Location location = token.location;
703 if (token.token == Token::STRING) {
707 return token.literal_chars.length() != source_length;
722 TokenDesc* current_; // desc for current token (as returned by Next())
723 TokenDesc* next_; // desc for next token (one token look-ahead)
724 TokenDesc* next_next_; // desc for the token after next (after PeakAhead())