| 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 #include "tools/gn/functions.h" | 5 #include "tools/gn/functions.h" |
| 6 | 6 |
| 7 #include "tools/gn/parse_tree.h" | 7 #include "tools/gn/parse_tree.h" |
| 8 #include "tools/gn/scope.h" | 8 #include "tools/gn/scope.h" |
| 9 #include "tools/gn/template.h" | 9 #include "tools/gn/template.h" |
| 10 #include "tools/gn/value.h" | 10 #include "tools/gn/value.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // The "right" thing to do would be to walk the syntax tree inside the | 198 // The "right" thing to do would be to walk the syntax tree inside the |
| 199 // template, find all identifier references, and mark those variables used. | 199 // template, find all identifier references, and mark those variables used. |
| 200 // This is annoying and error-prone to implement and takes extra time to run | 200 // This is annoying and error-prone to implement and takes extra time to run |
| 201 // for this narrow use case. | 201 // for this narrow use case. |
| 202 // | 202 // |
| 203 // Templates are most often defined in .gni files which don't get | 203 // Templates are most often defined in .gni files which don't get |
| 204 // used-variable checking anyway, and this case is annoying enough that the | 204 // used-variable checking anyway, and this case is annoying enough that the |
| 205 // incremental value of unused variable checking isn't worth the | 205 // incremental value of unused variable checking isn't worth the |
| 206 // alternatives. So all values in scope before this template definition are | 206 // alternatives. So all values in scope before this template definition are |
| 207 // exempted from unused variable checking. | 207 // exempted from unused variable checking. |
| 208 scope->MarkAllUsed(); | 208 scope->MarkAllUsed(err); |
| 209 | 209 |
| 210 return Value(); | 210 return Value(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace functions | 213 } // namespace functions |
| OLD | NEW |