| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_SCOPES_H_ | 5 #ifndef VM_SCOPES_H_ |
| 6 #define VM_SCOPES_H_ | 6 #define VM_SCOPES_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // We mark a variable as 'captured' when applicable. | 280 // We mark a variable as 'captured' when applicable. |
| 281 LocalVariable* LookupVariable(const String& name, bool test_only); | 281 LocalVariable* LookupVariable(const String& name, bool test_only); |
| 282 | 282 |
| 283 // Lookup a label in this scope and its parents. | 283 // Lookup a label in this scope and its parents. |
| 284 SourceLabel* LookupLabel(const String& name); | 284 SourceLabel* LookupLabel(const String& name); |
| 285 | 285 |
| 286 // Lookup the "innermost" label that labels a for, while, do, or switch | 286 // Lookup the "innermost" label that labels a for, while, do, or switch |
| 287 // statement. | 287 // statement. |
| 288 SourceLabel* LookupInnermostLabel(Token::Kind jump_kind); | 288 SourceLabel* LookupInnermostLabel(Token::Kind jump_kind); |
| 289 | 289 |
| 290 // Lookup the label for the "innermost" catch block if one exists. | |
| 291 SourceLabel* LookupInnermostCatchLabel(); | |
| 292 | |
| 293 // Lookup scope of outer switch statement at same function level. | 290 // Lookup scope of outer switch statement at same function level. |
| 294 // Returns NULL if this scope is not embedded in a switch. | 291 // Returns NULL if this scope is not embedded in a switch. |
| 295 LocalScope* LookupSwitchScope(); | 292 LocalScope* LookupSwitchScope(); |
| 296 | 293 |
| 297 // Looks up variable in this scope and mark as captured if applicable. | 294 // Looks up variable in this scope and mark as captured if applicable. |
| 298 // Finds the variable even if it is marked invisible. Returns true if | 295 // Finds the variable even if it is marked invisible. Returns true if |
| 299 // the variable was found, false if it was not found. | 296 // the variable was found, false if it was not found. |
| 300 bool CaptureVariable(const String& name); | 297 bool CaptureVariable(const String& name); |
| 301 | 298 |
| 302 // Look for unresolved forward references to labels in this scope. | 299 // Look for unresolved forward references to labels in this scope. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // List of names referenced in this scope and its children that | 385 // List of names referenced in this scope and its children that |
| 389 // are not resolved to local variables. | 386 // are not resolved to local variables. |
| 390 GrowableArray<NameReference*> referenced_; | 387 GrowableArray<NameReference*> referenced_; |
| 391 | 388 |
| 392 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 389 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
| 393 }; | 390 }; |
| 394 | 391 |
| 395 } // namespace dart | 392 } // namespace dart |
| 396 | 393 |
| 397 #endif // VM_SCOPES_H_ | 394 #endif // VM_SCOPES_H_ |
| OLD | NEW |