Lines Matching refs:tok
99 Token tok; in findSemiAfterLocation() local
100 lexer.LexFromRawLexer(tok); in findSemiAfterLocation()
101 if (tok.isNot(tok::semi)) in findSemiAfterLocation()
104 return tok.getLocation(); in findSemiAfterLocation()
345 Token tok; in rewritePropertyAttribute() local
346 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
347 if (tok.isNot(tok::at)) return false; in rewritePropertyAttribute()
348 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
349 if (tok.isNot(tok::raw_identifier)) return false; in rewritePropertyAttribute()
350 if (StringRef(tok.getRawIdentifierData(), tok.getLength()) in rewritePropertyAttribute()
353 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
354 if (tok.isNot(tok::l_paren)) return false; in rewritePropertyAttribute()
356 Token BeforeTok = tok; in rewritePropertyAttribute()
361 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
362 if (tok.is(tok::r_paren)) in rewritePropertyAttribute()
366 if (tok.isNot(tok::raw_identifier)) return false; in rewritePropertyAttribute()
367 StringRef ident(tok.getRawIdentifierData(), tok.getLength()); in rewritePropertyAttribute()
370 Pass.TA.replaceText(tok.getLocation(), fromAttr, toAttr); in rewritePropertyAttribute()
374 AttrLoc = tok.getLocation(); in rewritePropertyAttribute()
378 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
379 if (AttrLoc.isValid() && AfterTok.is(tok::unknown)) in rewritePropertyAttribute()
380 AfterTok = tok; in rewritePropertyAttribute()
381 } while (tok.isNot(tok::comma) && tok.isNot(tok::r_paren)); in rewritePropertyAttribute()
382 if (tok.is(tok::r_paren)) in rewritePropertyAttribute()
385 BeforeTok = tok; in rewritePropertyAttribute()
386 lexer.LexFromRawLexer(tok); in rewritePropertyAttribute()
389 if (toAttr.empty() && AttrLoc.isValid() && AfterTok.isNot(tok::unknown)) { in rewritePropertyAttribute()
391 if (BeforeTok.is(tok::l_paren) && AfterTok.is(tok::r_paren)) { in rewritePropertyAttribute()
394 } else if (BeforeTok.is(tok::l_paren) && AfterTok.is(tok::comma)) { in rewritePropertyAttribute()
428 Token tok; in addPropertyAttribute() local
429 lexer.LexFromRawLexer(tok); in addPropertyAttribute()
430 if (tok.isNot(tok::at)) return false; in addPropertyAttribute()
431 lexer.LexFromRawLexer(tok); in addPropertyAttribute()
432 if (tok.isNot(tok::raw_identifier)) return false; in addPropertyAttribute()
433 if (StringRef(tok.getRawIdentifierData(), tok.getLength()) in addPropertyAttribute()
436 lexer.LexFromRawLexer(tok); in addPropertyAttribute()
438 if (tok.isNot(tok::l_paren)) { in addPropertyAttribute()
439 Pass.TA.insert(tok.getLocation(), std::string("(") + attr.str() + ") "); in addPropertyAttribute()
443 lexer.LexFromRawLexer(tok); in addPropertyAttribute()
444 if (tok.is(tok::r_paren)) { in addPropertyAttribute()
445 Pass.TA.insert(tok.getLocation(), attr); in addPropertyAttribute()
449 if (tok.isNot(tok::raw_identifier)) return false; in addPropertyAttribute()
451 Pass.TA.insert(tok.getLocation(), std::string(attr) + ", "); in addPropertyAttribute()