| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #import("../../../leg/leg.dart"); | 5 #import("../../../leg/leg.dart"); |
| 6 #import("../../../leg/elements/elements.dart"); | 6 #import("../../../leg/elements/elements.dart"); |
| 7 #import("../../../leg/tree/tree.dart"); | 7 #import("../../../leg/tree/tree.dart"); |
| 8 #import("../../../leg/util/util.dart"); | 8 #import("../../../leg/util/util.dart"); |
| 9 #import("mock_compiler.dart"); | 9 #import("mock_compiler.dart"); |
| 10 #import("parser_helper.dart"); | 10 #import("parser_helper.dart"); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 compiler.parseScript("var b, c;"); | 367 compiler.parseScript("var b, c;"); |
| 368 Element bElement = compiler.universe.find(buildSourceString("b")); | 368 Element bElement = compiler.universe.find(buildSourceString("b")); |
| 369 Element cElement = compiler.universe.find(buildSourceString("c")); | 369 Element cElement = compiler.universe.find(buildSourceString("c")); |
| 370 Expect.equals(ElementKind.FIELD, bElement.kind); | 370 Expect.equals(ElementKind.FIELD, bElement.kind); |
| 371 Expect.equals(ElementKind.FIELD, cElement.kind); | 371 Expect.equals(ElementKind.FIELD, cElement.kind); |
| 372 Expect.isTrue(bElement != cElement); | 372 Expect.isTrue(bElement != cElement); |
| 373 | 373 |
| 374 VariableDefinitions bNode = bElement.parseNode(compiler, compiler); | 374 VariableDefinitions bNode = bElement.parseNode(compiler, compiler); |
| 375 VariableDefinitions cNode = cElement.parseNode(compiler, compiler); | 375 VariableDefinitions cNode = cElement.parseNode(compiler, compiler); |
| 376 Expect.equals(bNode, cNode); | 376 Expect.equals(bNode, cNode); |
| 377 Expect.equals(bNode.type.typeName.source.stringValue, 'var'); | 377 Expect.isNull(bNode.type); |
| 378 Expect.isTrue(bNode.modifiers.isVar()); |
| 378 } | 379 } |
| 379 | 380 |
| 380 length(Link link) => link.isEmpty() ? 0 : length(link.tail) + 1; | 381 length(Link link) => link.isEmpty() ? 0 : length(link.tail) + 1; |
| 381 | 382 |
| 382 at(Link link, int index) => (index == 0) ? link.head : at(link.tail, index - 1); | 383 at(Link link, int index) => (index == 0) ? link.head : at(link.tail, index - 1); |
| OLD | NEW |