diff options
author | 2016-09-12 08:50:13 -0700 | |
---|---|---|
committer | 2016-09-12 08:50:13 -0700 | |
commit | 9b0fe3d125f237d9884732a48414fa85fc71b4e3 (patch) | |
tree | bf5470aacb44419cc3f5df2eded4f170be5a532a /src/sksl/SkSLParser.cpp | |
parent | d99858ad46ca2c3b5c38061be8b006b25d24c6e0 (diff) |
Turned on SkSL->GLSL compiler
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003
Review-Url: https://codereview.chromium.org/2288033003
Diffstat (limited to 'src/sksl/SkSLParser.cpp')
-rw-r--r-- | src/sksl/SkSLParser.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp index b240e4501e..f9e7498ee5 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; |