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 2288033003: Turned on SkSL->GLSL compiler (Closed)
Patch Set: wording cleanup Created 4 years, 3 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
Index: src/sksl/SkSLParser.cpp
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
index b240e4501e98a1f4847cd8c00ca784d854ee9a31..f9e7498ee5955975e000447fb30f4532290bf48b 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -185,7 +185,8 @@ void Parser::precision() {
this->expect(Token::SEMICOLON, "';'");
}
-/* DIRECTIVE(#version) INT_LITERAL | DIRECTIVE(#extension) IDENTIFIER COLON IDENTIFIER */
+/* DIRECTIVE(#version) INT_LITERAL ("es" | "compatibility")? |
+ DIRECTIVE(#extension) IDENTIFIER COLON IDENTIFIER */
std::unique_ptr<ASTDeclaration> Parser::directive() {
Token start;
if (!this->expect(Token::DIRECTIVE, "a directive", &start)) {
@@ -193,7 +194,12 @@ std::unique_ptr<ASTDeclaration> Parser::directive() {
}
if (start.fText == "#version") {
this->expect(Token::INT_LITERAL, "a version number");
- // ignored for now
+ Token next = this->peek();
+ if (next.fText == "es" || next.fText == "compatibility") {
+ this->nextToken();
+ }
+ // version is ignored for now; it will eventually become an error when we stop pretending
+ // to be GLSL
return nullptr;
} else if (start.fText == "#extension") {
Token name;

Powered by Google App Engine
This is Rietveld 408576698