blob: b9df3c52e9a730dadf43d18c18cbe76f45fa8d6a [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SKSL_ASTEXTENSION
9#define SKSL_ASTEXTENSION
10
11#include "SkSLASTDeclaration.h"
12
13namespace SkSL {
14
15/**
16 * An extension declaration.
17 */
18struct ASTExtension : public ASTDeclaration {
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050019 ASTExtension(Position position, SkString name)
ethannicholasb3058bd2016-07-01 08:22:01 -070020 : INHERITED(position, kExtension_Kind)
21 , fName(std::move(name)) {}
22
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050023 SkString description() const override {
ethannicholasb3058bd2016-07-01 08:22:01 -070024 return "#extension " + fName + " : enable";
25 }
26
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050027 const SkString fName;
ethannicholasb3058bd2016-07-01 08:22:01 -070028
29 typedef ASTDeclaration INHERITED;
30};
31
32} // namespace
33
34#endif