| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SKSL_ASTVARDECLARATIONS | 8 #ifndef SKSL_ASTVARDECLARATIONS |
| 9 #define SKSL_ASTVARDECLARATIONS | 9 #define SKSL_ASTVARDECLARATIONS |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } else { | 37 } else { |
| 38 result += "[]"; | 38 result += "[]"; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 if (fValue) { | 41 if (fValue) { |
| 42 result += " = " + fValue->description(); | 42 result += " = " + fValue->description(); |
| 43 } | 43 } |
| 44 return result; | 44 return result; |
| 45 } | 45 } |
| 46 | 46 |
| 47 const std::string fName; | 47 std::string fName; |
| 48 | 48 |
| 49 // array sizes, if any. e.g. 'foo[3][]' has sizes [3, null] | 49 // array sizes, if any. e.g. 'foo[3][]' has sizes [3, null] |
| 50 std::vector<std::unique_ptr<ASTExpression>> fSizes; | 50 std::vector<std::unique_ptr<ASTExpression>> fSizes; |
| 51 | 51 |
| 52 // initial value, may be null | 52 // initial value, may be null |
| 53 std::unique_ptr<ASTExpression> fValue; | 53 std::unique_ptr<ASTExpression> fValue; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * A variable declaration statement, which may consist of one or more individual
variables. | 57 * A variable declaration statement, which may consist of one or more individual
variables. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 const ASTModifiers fModifiers; | 79 const ASTModifiers fModifiers; |
| 80 const std::unique_ptr<ASTType> fType; | 80 const std::unique_ptr<ASTType> fType; |
| 81 const std::vector<ASTVarDeclaration> fVars; | 81 const std::vector<ASTVarDeclaration> fVars; |
| 82 | 82 |
| 83 typedef ASTDeclaration INHERITED; | 83 typedef ASTDeclaration INHERITED; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 | 87 |
| 88 #endif | 88 #endif |
| OLD | NEW |