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) { |