aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLParser.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2016-11-17 16:13:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-18 14:34:08 +0000
commitd8df21a1e08b5b3380261f4b90acfbdc538ef93c (patch)
treed0d9454eec7c469335c40938aa497c055f89297b /src/sksl/SkSLParser.h
parent833dcf48844dd053ddf7ecea20e3e1c2b6b47e01 (diff)
switched skslc from std::string to SkString
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4977 Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8 Reviewed-on: https://skia-review.googlesource.com/4977 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLParser.h')
-rw-r--r--src/sksl/SkSLParser.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sksl/SkSLParser.h b/src/sksl/SkSLParser.h
index f9dcde244f..f2b6fb87bb 100644
--- a/src/sksl/SkSLParser.h
+++ b/src/sksl/SkSLParser.h
@@ -8,7 +8,6 @@
#ifndef SKSL_PARSER
#define SKSL_PARSER
-#include <string>
#include <vector>
#include <memory>
#include <unordered_set>
@@ -49,7 +48,7 @@ class SymbolTable;
*/
class Parser {
public:
- Parser(std::string text, SymbolTable& types, ErrorReporter& errors);
+ Parser(SkString text, SymbolTable& types, ErrorReporter& errors);
~Parser();
@@ -87,15 +86,17 @@ private:
* If 'result' is non-null, it is set to point to the token that was read.
* Returns true if the read token was as expected, false otherwise.
*/
- bool expect(Token::Kind kind, std::string expected, Token* result = nullptr);
+ bool expect(Token::Kind kind, const char* expected, Token* result = nullptr);
+ bool expect(Token::Kind kind, SkString expected, Token* result = nullptr);
- void error(Position p, std::string msg);
+ void error(Position p, const char* msg);
+ void error(Position p, SkString msg);
/**
* Returns true if the 'name' identifier refers to a type name. For instance, isType("int") will
* always return true.
*/
- bool isType(std::string name);
+ bool isType(SkString name);
// these functions parse individual grammar rules from the current parse position; you probably
// don't need to call any of these outside of the parser. The function declarations in the .cpp
@@ -115,7 +116,7 @@ private:
std::unique_ptr<ASTVarDeclarations> varDeclarationEnd(ASTModifiers modifiers,
std::unique_ptr<ASTType> type,
- std::string name);
+ SkString name);
std::unique_ptr<ASTParameter> parameter();
@@ -195,7 +196,7 @@ private:
bool boolLiteral(bool* dest);
- bool identifier(std::string* dest);
+ bool identifier(SkString* dest);
void* fScanner;
YY_BUFFER_STATE fBuffer;