Index: src/sksl/SkSLParser.cpp |
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp |
index 7eac0ce5679d5de60909e29afd8257c6dc910d27..324bd41c86c972f39e9ad3714ef4069c90d8c6dd 100644 |
--- a/src/sksl/SkSLParser.cpp |
+++ b/src/sksl/SkSLParser.cpp |
@@ -157,9 +157,18 @@ Token Parser::nextToken() { |
return result; |
} |
int token = sksllex(fScanner); |
- return Token(Position(skslget_lineno(fScanner), -1), (Token::Kind) token, |
- token == Token::END_OF_FILE ? "<end of file>" : |
- std::string(skslget_text(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); |
} |
void Parser::pushback(Token t) { |