aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLParser.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-03-30 18:42:48 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-30 18:42:59 +0000
commitbcf35f86d50b784b165de703b404998dd4299f6a (patch)
tree9fcd85326b1a5dbda864da9431a878bb62f65191 /src/sksl/SkSLParser.cpp
parent7833466da45bfa1e078427c4a6db94d41c5c1535 (diff)
Revert "skslc can now be compiled with no Skia dependencies, in preparation for"
This reverts commit 7833466da45bfa1e078427c4a6db94d41c5c1535. Reason for revert: Vulkan assertion failure Original change's description: > skslc can now be compiled with no Skia dependencies, in preparation for > its eventual role in Skia's build process. > > Bug: skia: > Change-Id: Iaa9933f4fc4a64bec60aa897c509a3513f457a78 > Reviewed-on: https://skia-review.googlesource.com/10282 > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > TBR=egdaniel@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic64cac2395abb406116885ddd725f74a434c8c49 Reviewed-on: https://skia-review.googlesource.com/10758 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLParser.cpp')
-rw-r--r--src/sksl/SkSLParser.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
index 1004de85b1..e24685a51d 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -79,7 +79,7 @@ public:
bool checkValid() {
if (fParser->fDepth > MAX_PARSE_DEPTH) {
- fParser->error(fParser->peek().fPosition, String("exceeded max parse depth"));
+ fParser->error(fParser->peek().fPosition, SkString("exceeded max parse depth"));
return false;
}
return true;
@@ -89,8 +89,8 @@ private:
Parser* fParser;
};
-Parser::Parser(String text, SymbolTable& types, ErrorReporter& errors)
-: fPushback(Position(-1, -1), Token::INVALID_TOKEN, String())
+Parser::Parser(SkString text, SymbolTable& types, ErrorReporter& errors)
+: fPushback(Position(-1, -1), Token::INVALID_TOKEN, SkString())
, fTypes(types)
, fErrors(errors) {
sksllex_init(&fScanner);
@@ -150,17 +150,17 @@ Token Parser::nextToken() {
return result;
}
int token = sksllex(fScanner);
- String text;
+ SkString 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 = String(skslget_text(fScanner));
+ text = SkString(skslget_text(fScanner));
break;
default:
#ifdef SK_DEBUG
- text = String(skslget_text(fScanner));
+ text = SkString(skslget_text(fScanner));
#endif
break;
}
@@ -179,10 +179,10 @@ Token Parser::peek() {
bool Parser::expect(Token::Kind kind, const char* expected, Token* result) {
- return this->expect(kind, String(expected), result);
+ return this->expect(kind, SkString(expected), result);
}
-bool Parser::expect(Token::Kind kind, String expected, Token* result) {
+bool Parser::expect(Token::Kind kind, SkString expected, Token* result) {
Token next = this->nextToken();
if (next.fKind == kind) {
if (result) {
@@ -201,14 +201,14 @@ bool Parser::expect(Token::Kind kind, String expected, Token* result) {
}
void Parser::error(Position p, const char* msg) {
- this->error(p, String(msg));
+ this->error(p, SkString(msg));
}
-void Parser::error(Position p, String msg) {
+void Parser::error(Position p, SkString msg) {
fErrors.error(p, msg);
}
-bool Parser::isType(String name) {
+bool Parser::isType(SkString name) {
return nullptr != fTypes[name];
}
@@ -380,7 +380,7 @@ std::unique_ptr<ASTType> Parser::structDeclaration() {
return nullptr;
}
uint64_t columns = ((ASTIntLiteral&) *var.fSizes[i]).fValue;
- String name = type->name() + "[" + to_string(columns) + "]";
+ SkString name = type->name() + "[" + to_string(columns) + "]";
type = new Type(name, Type::kArray_Kind, *type, (int) columns);
fTypes.takeOwnership((Type*) type);
}
@@ -427,7 +427,7 @@ std::unique_ptr<ASTVarDeclarations> Parser::structVarDeclaration(Modifiers modif
(LBRACKET expression? RBRACKET)* (EQ expression)?)* SEMICOLON */
std::unique_ptr<ASTVarDeclarations> Parser::varDeclarationEnd(Modifiers mods,
std::unique_ptr<ASTType> type,
- String name) {
+ SkString name) {
std::vector<ASTVarDeclaration> vars;
std::vector<std::unique_ptr<ASTExpression>> currentVarSizes;
while (this->peek().fKind == Token::LBRACKET) {
@@ -837,7 +837,7 @@ std::unique_ptr<ASTDeclaration> Parser::interfaceBlock(Modifiers mods) {
decls.push_back(std::move(decl));
}
this->nextToken();
- String instanceName;
+ SkString instanceName;
std::vector<std::unique_ptr<ASTExpression>> sizes;
if (this->peek().fKind == Token::IDENTIFIER) {
instanceName = this->nextToken().fText;
@@ -1008,7 +1008,7 @@ std::unique_ptr<ASTStatement> Parser::switchStatement() {
// parts of the compiler may rely upon this assumption.
if (this->peek().fKind == Token::DEFAULT) {
Token defaultStart;
- ASSERT_RESULT(this->expect(Token::DEFAULT, "'default'", &defaultStart));
+ SkAssertResult(this->expect(Token::DEFAULT, "'default'", &defaultStart));
if (!this->expect(Token::COLON, "':'")) {
return nullptr;
}
@@ -1562,7 +1562,7 @@ std::unique_ptr<ASTSuffix> Parser::suffix() {
}
case Token::DOT: {
Position pos = this->peek().fPosition;
- String text;
+ SkString text;
if (this->identifier(&text)) {
return std::unique_ptr<ASTSuffix>(new ASTFieldSuffix(pos, std::move(text)));
}
@@ -1607,7 +1607,7 @@ std::unique_ptr<ASTExpression> Parser::term() {
Token t = this->peek();
switch (t.fKind) {
case Token::IDENTIFIER: {
- String text;
+ SkString text;
if (this->identifier(&text)) {
result.reset(new ASTIdentifier(t.fPosition, std::move(text)));
}
@@ -1688,7 +1688,7 @@ bool Parser::boolLiteral(bool* dest) {
}
/* IDENTIFIER */
-bool Parser::identifier(String* dest) {
+bool Parser::identifier(SkString* dest) {
Token t;
if (this->expect(Token::IDENTIFIER, "identifier", &t)) {
*dest = t.fText;