OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (name != null && !name.isEmpty()) { | 87 if (name != null && !name.isEmpty()) { |
88 if (definedNames.containsKey(name)) { | 88 if (definedNames.containsKey(name)) { |
89 getErrorListener().onError(getErrorForDuplicate(definedNames.get(name),
element)); | 89 getErrorListener().onError(getErrorForDuplicate(definedNames.get(name),
element)); |
90 } else { | 90 } else { |
91 definedNames.put(name, element); | 91 definedNames.put(name, element); |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 /** | 96 /** |
| 97 * Return the scope in which this scope is lexically enclosed. |
| 98 * |
| 99 * @return the scope in which this scope is lexically enclosed |
| 100 */ |
| 101 public Scope getEnclosingScope() { |
| 102 return null; |
| 103 } |
| 104 |
| 105 /** |
97 * Return the element with which the given identifier is associated, or {@code
null} if the name | 106 * Return the element with which the given identifier is associated, or {@code
null} if the name |
98 * is not defined within this scope. | 107 * is not defined within this scope. |
99 * | 108 * |
100 * @param identifier the identifier associated with the element to be returned | 109 * @param identifier the identifier associated with the element to be returned |
101 * @param referencingLibrary the library that contains the reference to the na
me, used to | 110 * @param referencingLibrary the library that contains the reference to the na
me, used to |
102 * implement library-level privacy | 111 * implement library-level privacy |
103 * @return the element with which the given identifier is associated | 112 * @return the element with which the given identifier is associated |
104 */ | 113 */ |
105 public Element lookup(Identifier identifier, LibraryElement referencingLibrary
) { | 114 public Element lookup(Identifier identifier, LibraryElement referencingLibrary
) { |
106 return lookup(identifier, identifier.getName(), referencingLibrary); | 115 return lookup(identifier, identifier.getName(), referencingLibrary); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 private String getName(Element element) { | 217 private String getName(Element element) { |
209 if (element instanceof MethodElement) { | 218 if (element instanceof MethodElement) { |
210 MethodElement method = (MethodElement) element; | 219 MethodElement method = (MethodElement) element; |
211 if (method.getName().equals("-") && method.getParameters().length == 0) { | 220 if (method.getName().equals("-") && method.getParameters().length == 0) { |
212 return UNARY_MINUS; | 221 return UNARY_MINUS; |
213 } | 222 } |
214 } | 223 } |
215 return element.getName(); | 224 return element.getName(); |
216 } | 225 } |
217 } | 226 } |
OLD | NEW |