Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/sksl/SkSLParser.cpp

Issue 2458723002: Revert of Reduced skslc memory consumption (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLIRGenerator.cpp ('k') | src/sksl/SkSLToken.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/SkSLParser.cpp
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
index 19e60999e9156241408b8e04f831e69a0dd351b0..2699d9c113d076dee0844196220ed0bff1734806 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -132,18 +132,9 @@
return result;
}
int token = sksllex(fScanner);
- std::string text;
- switch ((Token::Kind) token) {
- case Token::IDENTIFIER: // fall through
- case Token::INT_LITERAL: // fall through
- case Token::FLOAT_LITERAL: // fall through
- case Token::DIRECTIVE:
- text = std::string(skslget_text(fScanner));
- break;
- default:
- break;
- }
- return Token(Position(skslget_lineno(fScanner), -1), (Token::Kind) token, text);
+ return Token(Position(skslget_lineno(fScanner), -1), (Token::Kind) token,
+ token == Token::END_OF_FILE ? "<end of file>" :
+ std::string(skslget_text(fScanner)));
}
void Parser::pushback(Token t) {
« no previous file with comments | « src/sksl/SkSLIRGenerator.cpp ('k') | src/sksl/SkSLToken.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698