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

Unified Diff: dart/lib/compiler/implementation/scanner/class_element_parser.dart

Issue 10892005: Revert "Support unary - operator." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: dart/lib/compiler/implementation/scanner/class_element_parser.dart
diff --git a/dart/lib/compiler/implementation/scanner/class_element_parser.dart b/dart/lib/compiler/implementation/scanner/class_element_parser.dart
index 545688c29179752ebfd51910d1736b4624e3fba8..bf0c1ddc6f35765723ab3ac02ed8ad523c41da23 100644
--- a/dart/lib/compiler/implementation/scanner/class_element_parser.dart
+++ b/dart/lib/compiler/implementation/scanner/class_element_parser.dart
@@ -32,27 +32,22 @@ class PartialClassElement extends ClassElement {
super.resolutionState = state;
}
- ClassNode parseNode(Compiler compiler) {
+ ClassNode parseNode(DiagnosticListener diagnosticListener) {
if (cachedNode != null) return cachedNode;
- compiler.withCurrentElement(this, () {
- compiler.parser.measure(() {
- MemberListener listener = new MemberListener(compiler, this);
- Parser parser = new ClassElementParser(listener);
- Token token = parser.parseTopLevelDeclaration(beginToken);
- assert(token === endToken.next);
- cachedNode = listener.popNode();
- assert(listener.nodes.isEmpty());
- });
- compiler.patchParser.measure(() {
- if (isPatched) {
- // TODO(lrn): Perhaps extract functionality so it doesn't
- // need compiler.
- ClassNode patchNode = compiler.patchParser.parsePatchClassNode(patch);
- Link<Element> patches = patch.localMembers;
- compiler.applyContainerPatch(this, patches);
- }
- });
- });
+ // TODO(ahe): Measure these tasks.
+ MemberListener listener = new MemberListener(diagnosticListener, this);
+ Parser parser = new ClassElementParser(listener);
+ Token token = parser.parseTopLevelDeclaration(beginToken);
+ assert(token === endToken.next);
+ cachedNode = listener.popNode();
+ assert(listener.nodes.isEmpty());
+ if (isPatched) {
+ // TODO(lrn): Perhaps extract functionality so it doesn't need compiler.
+ Compiler compiler = diagnosticListener;
+ ClassNode patchNode = compiler.patchParser.parsePatchClassNode(patch);
+ Link<Element> patches = patch.localMembers;
+ compiler.applyContainerPatch(this, patches);
+ }
return cachedNode;
}
@@ -119,13 +114,8 @@ class MemberListener extends NodeListener {
if (send === null) return methodName.asIdentifier().source;
Identifier receiver = send.receiver.asIdentifier();
Identifier selector = send.selector.asIdentifier();
- Operator operator = selector.asOperator();
- if (operator !== null) {
- assert(receiver.source.stringValue === 'operator');
- // TODO(ahe): It is a hack to compare to ')', but it beats
- // parsing the node.
- bool isUnary = operator.token.next.next.stringValue === ')';
- return Elements.constructOperatorName(operator.source, isUnary);
+ if (selector.asOperator() !== null) {
+ return Elements.constructOperatorName(receiver.source, selector.source);
} else {
return Elements.constructConstructorName(receiver.source,
selector.source);
« no previous file with comments | « dart/lib/compiler/implementation/lib/interceptors.dart ('k') | dart/lib/compiler/implementation/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698