OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_GN_SCOPE_H_ | 5 #ifndef TOOLS_GN_SCOPE_H_ |
6 #define TOOLS_GN_SCOPE_H_ | 6 #define TOOLS_GN_SCOPE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // called before replacing the var with a different one. It does not check | 143 // called before replacing the var with a different one. It does not check |
144 // containing scopes. | 144 // containing scopes. |
145 // | 145 // |
146 // If the identifier is present but hasnn't been used, return true. | 146 // If the identifier is present but hasnn't been used, return true. |
147 bool IsSetButUnused(const base::StringPiece& ident) const; | 147 bool IsSetButUnused(const base::StringPiece& ident) const; |
148 | 148 |
149 // Checks the scope to see if any values were set but not used, and fills in | 149 // Checks the scope to see if any values were set but not used, and fills in |
150 // the error and returns false if they were. | 150 // the error and returns false if they were. |
151 bool CheckForUnusedVars(Err* err) const; | 151 bool CheckForUnusedVars(Err* err) const; |
152 | 152 |
153 // Returns all values set in the current scope, without going to the parent | 153 // Returns all key/values or just the keys set in the current scope, |
154 // scopes. | 154 // without going to the parent scopes. |
155 void GetCurrentScopeValues(KeyValueMap* output) const; | 155 void GetCurrentScopeValues(KeyValueMap* output) const; |
| 156 void GetCurrentScopeKeys(std::vector<base::StringPiece>* output) const; |
156 | 157 |
157 // Copies this scope's values into the destination. Values from the | 158 // Copies this scope's values into the destination. Values from the |
158 // containing scope(s) (normally shadowed into the current one) will not be | 159 // containing scope(s) (normally shadowed into the current one) will not be |
159 // copied, neither will the reference to the containing scope (this is why | 160 // copied, neither will the reference to the containing scope (this is why |
160 // it's "non-recursive"). | 161 // it's "non-recursive"). |
161 // | 162 // |
162 // If clobber_existing is true, any existing values will be overwritten. In | 163 // If clobber_existing is true, any existing values will be overwritten. In |
163 // this mode, this function will never fail. | 164 // this mode, this function will never fail. |
164 // | 165 // |
165 // If clobber_existing is false, it will be an error to merge a variable into | 166 // If clobber_existing is false, it will be an error to merge a variable into |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 290 |
290 typedef std::set<ProgrammaticProvider*> ProviderSet; | 291 typedef std::set<ProgrammaticProvider*> ProviderSet; |
291 ProviderSet programmatic_providers_; | 292 ProviderSet programmatic_providers_; |
292 | 293 |
293 SourceDir source_dir_; | 294 SourceDir source_dir_; |
294 | 295 |
295 DISALLOW_COPY_AND_ASSIGN(Scope); | 296 DISALLOW_COPY_AND_ASSIGN(Scope); |
296 }; | 297 }; |
297 | 298 |
298 #endif // TOOLS_GN_SCOPE_H_ | 299 #endif // TOOLS_GN_SCOPE_H_ |
OLD | NEW |