Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 1158793004: Add isExternal accessor to element model (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after
3360 */ 3360 */
3361 static const List<ExecutableElement> EMPTY_LIST = const <ExecutableElement>[]; 3361 static const List<ExecutableElement> EMPTY_LIST = const <ExecutableElement>[];
3362 3362
3363 /** 3363 /**
3364 * Return a list containing all of the functions defined within this 3364 * Return a list containing all of the functions defined within this
3365 * executable element. 3365 * executable element.
3366 */ 3366 */
3367 List<FunctionElement> get functions; 3367 List<FunctionElement> get functions;
3368 3368
3369 /** 3369 /**
3370 * Return `true` if this executable element is abstract. 3370 * Return `true` if this executable element is abstract. Executable elements
3371 * Executable elements are abstract if they are not external and have no body. 3371 * are abstract if they are not external and have no body.
3372 */ 3372 */
3373 bool get isAbstract; 3373 bool get isAbstract;
3374 3374
3375 /** 3375 /**
3376 * Return `true` if this executable element has body marked as being 3376 * Return `true` if this executable element has body marked as being
3377 * asynchronous. 3377 * asynchronous.
3378 */ 3378 */
3379 bool get isAsynchronous; 3379 bool get isAsynchronous;
3380 3380
3381 /** 3381 /**
3382 * Return `true` if this executable element is external. Executable elements
3383 * are external if they are explicitly marked as such using the 'external'
3384 * keyword.
3385 */
3386 bool get isExternal;
3387
3388 /**
3382 * Return `true` if this executable element has a body marked as being a 3389 * Return `true` if this executable element has a body marked as being a
3383 * generator. 3390 * generator.
3384 */ 3391 */
3385 bool get isGenerator; 3392 bool get isGenerator;
3386 3393
3387 /** 3394 /**
3388 * Return `true` if this executable element is an operator. The test may be 3395 * Return `true` if this executable element is an operator. The test may be
3389 * based on the name of the executable element, in which case the result will 3396 * based on the name of the executable element, in which case the result will
3390 * be correct when the name is legal. 3397 * be correct when the name is legal.
3391 */ 3398 */
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
3482 * [offset]. 3489 * [offset].
3483 */ 3490 */
3484 ExecutableElementImpl(String name, int offset) : super(name, offset); 3491 ExecutableElementImpl(String name, int offset) : super(name, offset);
3485 3492
3486 /** 3493 /**
3487 * Initialize a newly created executable element to have the given [name]. 3494 * Initialize a newly created executable element to have the given [name].
3488 */ 3495 */
3489 ExecutableElementImpl.forNode(Identifier name) : super.forNode(name); 3496 ExecutableElementImpl.forNode(Identifier name) : super.forNode(name);
3490 3497
3491 /** 3498 /**
3492 * Set whether this method's body is asynchronous. 3499 * Set whether this executable element's body is asynchronous.
3493 */ 3500 */
3494 void set asynchronous(bool isAsynchronous) { 3501 void set asynchronous(bool isAsynchronous) {
3495 setModifier(Modifier.ASYNCHRONOUS, isAsynchronous); 3502 setModifier(Modifier.ASYNCHRONOUS, isAsynchronous);
3496 } 3503 }
3497 3504
3505 /**
3506 * Set whether this executable element is external.
3507 */
3508 void set external(bool isExternal) {
3509 setModifier(Modifier.EXTERNAL, isExternal);
3510 }
3511
3498 @override 3512 @override
3499 List<FunctionElement> get functions => _functions; 3513 List<FunctionElement> get functions => _functions;
3500 3514
3501 /** 3515 /**
3502 * Set the functions defined within this executable element to the given 3516 * Set the functions defined within this executable element to the given
3503 * [functions]. 3517 * [functions].
3504 */ 3518 */
3505 void set functions(List<FunctionElement> functions) { 3519 void set functions(List<FunctionElement> functions) {
3506 for (FunctionElement function in functions) { 3520 for (FunctionElement function in functions) {
3507 (function as FunctionElementImpl).enclosingElement = this; 3521 (function as FunctionElementImpl).enclosingElement = this;
3508 } 3522 }
3509 this._functions = functions; 3523 this._functions = functions;
3510 } 3524 }
3511 3525
3512 /** 3526 /**
3513 * Set whether this method's body is a generator. 3527 * Set whether this method's body is a generator.
3514 */ 3528 */
3515 void set generator(bool isGenerator) { 3529 void set generator(bool isGenerator) {
3516 setModifier(Modifier.GENERATOR, isGenerator); 3530 setModifier(Modifier.GENERATOR, isGenerator);
3517 } 3531 }
3518 3532
3519 @override 3533 @override
3520 bool get isAbstract => hasModifier(Modifier.ABSTRACT); 3534 bool get isAbstract => hasModifier(Modifier.ABSTRACT);
3521 3535
3522 @override 3536 @override
3523 bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS); 3537 bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS);
3524 3538
3525 @override 3539 @override
3540 bool get isExternal => hasModifier(Modifier.EXTERNAL);
3541
3542 @override
3526 bool get isGenerator => hasModifier(Modifier.GENERATOR); 3543 bool get isGenerator => hasModifier(Modifier.GENERATOR);
3527 3544
3528 @override 3545 @override
3529 bool get isOperator => false; 3546 bool get isOperator => false;
3530 3547
3531 @override 3548 @override
3532 bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS); 3549 bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS);
3533 3550
3534 @override 3551 @override
3535 List<LabelElement> get labels => _labels; 3552 List<LabelElement> get labels => _labels;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3674 // return getBaseElement().getFunctions(); 3691 // return getBaseElement().getFunctions();
3675 } 3692 }
3676 3693
3677 @override 3694 @override
3678 bool get isAbstract => baseElement.isAbstract; 3695 bool get isAbstract => baseElement.isAbstract;
3679 3696
3680 @override 3697 @override
3681 bool get isAsynchronous => baseElement.isAsynchronous; 3698 bool get isAsynchronous => baseElement.isAsynchronous;
3682 3699
3683 @override 3700 @override
3701 bool get isExternal => baseElement.isExternal;
3702
3703 @override
3684 bool get isGenerator => baseElement.isGenerator; 3704 bool get isGenerator => baseElement.isGenerator;
3685 3705
3686 @override 3706 @override
3687 bool get isOperator => baseElement.isOperator; 3707 bool get isOperator => baseElement.isOperator;
3688 3708
3689 @override 3709 @override
3690 bool get isStatic => baseElement.isStatic; 3710 bool get isStatic => baseElement.isStatic;
3691 3711
3692 @override 3712 @override
3693 bool get isSynchronous => baseElement.isSynchronous; 3713 bool get isSynchronous => baseElement.isSynchronous;
(...skipping 4267 matching lines...) Expand 10 before | Expand all | Expand 10 after
7961 * Indicates that the import element represents a deferred library. 7981 * Indicates that the import element represents a deferred library.
7962 */ 7982 */
7963 static const Modifier DEFERRED = const Modifier('DEFERRED', 3); 7983 static const Modifier DEFERRED = const Modifier('DEFERRED', 3);
7964 7984
7965 /** 7985 /**
7966 * Indicates that a class element was defined by an enum declaration. 7986 * Indicates that a class element was defined by an enum declaration.
7967 */ 7987 */
7968 static const Modifier ENUM = const Modifier('ENUM', 4); 7988 static const Modifier ENUM = const Modifier('ENUM', 4);
7969 7989
7970 /** 7990 /**
7991 * Indicates that a class element was defined by an enum declaration.
7992 */
7993 static const Modifier EXTERNAL = const Modifier('EXTERNAL', 5);
7994
7995 /**
7971 * Indicates that the modifier 'factory' was applied to the element. 7996 * Indicates that the modifier 'factory' was applied to the element.
7972 */ 7997 */
7973 static const Modifier FACTORY = const Modifier('FACTORY', 5); 7998 static const Modifier FACTORY = const Modifier('FACTORY', 6);
7974 7999
7975 /** 8000 /**
7976 * Indicates that the modifier 'final' was applied to the element. 8001 * Indicates that the modifier 'final' was applied to the element.
7977 */ 8002 */
7978 static const Modifier FINAL = const Modifier('FINAL', 6); 8003 static const Modifier FINAL = const Modifier('FINAL', 7);
7979 8004
7980 /** 8005 /**
7981 * Indicates that an executable element has a body marked as being a 8006 * Indicates that an executable element has a body marked as being a
7982 * generator. 8007 * generator.
7983 */ 8008 */
7984 static const Modifier GENERATOR = const Modifier('GENERATOR', 7); 8009 static const Modifier GENERATOR = const Modifier('GENERATOR', 8);
7985 8010
7986 /** 8011 /**
7987 * Indicates that the pseudo-modifier 'get' was applied to the element. 8012 * Indicates that the pseudo-modifier 'get' was applied to the element.
7988 */ 8013 */
7989 static const Modifier GETTER = const Modifier('GETTER', 8); 8014 static const Modifier GETTER = const Modifier('GETTER', 9);
7990 8015
7991 /** 8016 /**
7992 * A flag used for libraries indicating that the defining compilation unit 8017 * A flag used for libraries indicating that the defining compilation unit
7993 * contains at least one import directive whose URI uses the "dart-ext" 8018 * contains at least one import directive whose URI uses the "dart-ext"
7994 * scheme. 8019 * scheme.
7995 */ 8020 */
7996 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 9); 8021 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 10);
7997 8022
7998 /** 8023 /**
7999 * Indicates that a class can validly be used as a mixin. 8024 * Indicates that a class can validly be used as a mixin.
8000 */ 8025 */
8001 static const Modifier MIXIN = const Modifier('MIXIN', 10); 8026 static const Modifier MIXIN = const Modifier('MIXIN', 11);
8002 8027
8003 /** 8028 /**
8004 * Indicates that a class is a mixin application. 8029 * Indicates that a class is a mixin application.
8005 */ 8030 */
8006 static const Modifier MIXIN_APPLICATION = 8031 static const Modifier MIXIN_APPLICATION =
8007 const Modifier('MIXIN_APPLICATION', 11); 8032 const Modifier('MIXIN_APPLICATION', 12);
8008 8033
8009 /** 8034 /**
8010 * Indicates that an error has reported explaining why this class is an 8035 * Indicates that an error has reported explaining why this class is an
8011 * invalid mixin application. 8036 * invalid mixin application.
8012 */ 8037 */
8013 static const Modifier MIXIN_ERRORS_REPORTED = 8038 static const Modifier MIXIN_ERRORS_REPORTED =
8014 const Modifier('MIXIN_ERRORS_REPORTED', 12); 8039 const Modifier('MIXIN_ERRORS_REPORTED', 13);
8015 8040
8016 /** 8041 /**
8017 * Indicates that the value of a parameter or local variable might be mutated 8042 * Indicates that the value of a parameter or local variable might be mutated
8018 * within the context. 8043 * within the context.
8019 */ 8044 */
8020 static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT = 8045 static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT =
8021 const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 13); 8046 const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 14);
8022 8047
8023 /** 8048 /**
8024 * Indicates that the value of a parameter or local variable might be mutated 8049 * Indicates that the value of a parameter or local variable might be mutated
8025 * within the scope. 8050 * within the scope.
8026 */ 8051 */
8027 static const Modifier POTENTIALLY_MUTATED_IN_SCOPE = 8052 static const Modifier POTENTIALLY_MUTATED_IN_SCOPE =
8028 const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 14); 8053 const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 15);
8029 8054
8030 /** 8055 /**
8031 * Indicates that a class contains an explicit reference to 'super'. 8056 * Indicates that a class contains an explicit reference to 'super'.
8032 */ 8057 */
8033 static const Modifier REFERENCES_SUPER = 8058 static const Modifier REFERENCES_SUPER =
8034 const Modifier('REFERENCES_SUPER', 15); 8059 const Modifier('REFERENCES_SUPER', 16);
8035 8060
8036 /** 8061 /**
8037 * Indicates that the pseudo-modifier 'set' was applied to the element. 8062 * Indicates that the pseudo-modifier 'set' was applied to the element.
8038 */ 8063 */
8039 static const Modifier SETTER = const Modifier('SETTER', 16); 8064 static const Modifier SETTER = const Modifier('SETTER', 17);
8040 8065
8041 /** 8066 /**
8042 * Indicates that the modifier 'static' was applied to the element. 8067 * Indicates that the modifier 'static' was applied to the element.
8043 */ 8068 */
8044 static const Modifier STATIC = const Modifier('STATIC', 17); 8069 static const Modifier STATIC = const Modifier('STATIC', 18);
8045 8070
8046 /** 8071 /**
8047 * Indicates that the element does not appear in the source code but was 8072 * Indicates that the element does not appear in the source code but was
8048 * implicitly created. For example, if a class does not define any 8073 * implicitly created. For example, if a class does not define any
8049 * constructors, an implicit zero-argument constructor will be created and it 8074 * constructors, an implicit zero-argument constructor will be created and it
8050 * will be marked as being synthetic. 8075 * will be marked as being synthetic.
8051 */ 8076 */
8052 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 18); 8077 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 19);
8053 8078
8054 static const List<Modifier> values = const [ 8079 static const List<Modifier> values = const [
8055 ABSTRACT, 8080 ABSTRACT,
8056 ASYNCHRONOUS, 8081 ASYNCHRONOUS,
8057 CONST, 8082 CONST,
8058 DEFERRED, 8083 DEFERRED,
8059 ENUM, 8084 ENUM,
8085 EXTERNAL,
8060 FACTORY, 8086 FACTORY,
8061 FINAL, 8087 FINAL,
8062 GENERATOR, 8088 GENERATOR,
8063 GETTER, 8089 GETTER,
8064 HAS_EXT_URI, 8090 HAS_EXT_URI,
8065 MIXIN, 8091 MIXIN,
8066 MIXIN_APPLICATION, 8092 MIXIN_APPLICATION,
8067 MIXIN_ERRORS_REPORTED, 8093 MIXIN_ERRORS_REPORTED,
8068 POTENTIALLY_MUTATED_IN_CONTEXT, 8094 POTENTIALLY_MUTATED_IN_CONTEXT,
8069 POTENTIALLY_MUTATED_IN_SCOPE, 8095 POTENTIALLY_MUTATED_IN_SCOPE,
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after
10414 10440
10415 @override 10441 @override
10416 void visitElement(Element element) { 10442 void visitElement(Element element) {
10417 int offset = element.nameOffset; 10443 int offset = element.nameOffset;
10418 if (offset != -1) { 10444 if (offset != -1) {
10419 map[offset] = element; 10445 map[offset] = element;
10420 } 10446 }
10421 super.visitElement(element); 10447 super.visitElement(element);
10422 } 10448 }
10423 } 10449 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698