Lines Matching refs:token

18 // symbolic token name, string is the corresponding syntactic symbol
20 // The parameters are invoked for token categories as follows:
198 /* Illegal token - not able to scan. */ \
209 // All token values.
214 // Returns a string corresponding to the C++ token name
215 // (e.g. "LT" for the token LT).
216 static const char* Name(Value token) {
217 DCHECK_GT(NUM_TOKENS, token); // token is unsigned
218 return name_[token];
225 static bool IsKeyword(Value token) {
226 return IsKeywordBits::decode(token_flags[token]);
229 static bool IsPropertyName(Value token) {
230 return IsPropertyNameBits::decode(token_flags[token]);
233 V8_INLINE static bool IsValidIdentifier(Value token,
237 if (V8_LIKELY(base::IsInRange(token, IDENTIFIER, ASYNC))) return true;
238 if (token == AWAIT) return !disallow_await;
239 if (token == YIELD) return !is_generator && is_sloppy(language_mode);
240 return IsStrictReservedWord(token) && is_sloppy(language_mode);
243 static bool IsCallable(Value token) {
244 return base::IsInRange(token, SUPER, ESCAPED_STRICT_RESERVED_WORD);
247 static bool IsAutoSemicolon(Value token) {
248 return base::IsInRange(token, SEMICOLON, EOS);
251 static bool IsAnyIdentifier(Value token) {
252 return base::IsInRange(token, IDENTIFIER, ESCAPED_STRICT_RESERVED_WORD);
255 static bool IsStrictReservedWord(Value token) {
256 return base::IsInRange(token, YIELD, ESCAPED_STRICT_RESERVED_WORD);
259 static bool IsLiteral(Value token) {
260 return base::IsInRange(token, NULL_LITERAL, STRING);
263 static bool IsTemplate(Value token) {
264 return base::IsInRange(token, TEMPLATE_SPAN, TEMPLATE_TAIL);
267 static bool IsMember(Value token) {
268 return base::IsInRange(token, TEMPLATE_SPAN, LBRACK);
271 static bool IsProperty(Value token) {
272 return base::IsInRange(token, PERIOD, LBRACK);
275 static bool IsPropertyOrCall(Value token) {
276 return base::IsInRange(token, TEMPLATE_SPAN, LPAREN);
279 static bool IsArrowOrAssignmentOp(Value token) {
280 return base::IsInRange(token, ARROW, ASSIGN_SUB);
283 static bool IsAssignmentOp(Value token) {
284 return base::IsInRange(token, INIT, ASSIGN_SUB);
287 static bool IsLogicalAssignmentOp(Value token) {
288 return base::IsInRange(token, ASSIGN_NULLISH, ASSIGN_AND);
321 // Returns a string corresponding to the JS token string
322 // (.e., "<" for the token LT) or nullptr if the token doesn't
324 static const char* String(Value token) {
325 DCHECK_GT(NUM_TOKENS, token); // token is unsigned
326 return string_[token];
329 static uint8_t StringLength(Value token) {
330 DCHECK_GT(NUM_TOKENS, token); // token is unsigned
331 return string_length_[token];
336 static int Precedence(Value token, bool accept_IN) {
337 DCHECK_GT(NUM_TOKENS, token); // token is unsigned
338 return precedence_[accept_IN][token];