| OLD | NEW |
| 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 library dart_style.src.source_visitor; | 5 library dart_style.src.source_visitor; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/src/generated/scanner.dart'; | 8 import 'package:analyzer/src/generated/scanner.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 | 10 |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 | 801 |
| 802 visitLibraryDirective(LibraryDirective node) { | 802 visitLibraryDirective(LibraryDirective node) { |
| 803 visitDeclarationMetadata(node.metadata); | 803 visitDeclarationMetadata(node.metadata); |
| 804 token(node.keyword); | 804 token(node.keyword); |
| 805 space(); | 805 space(); |
| 806 visit(node.name); | 806 visit(node.name); |
| 807 token(node.semicolon); | 807 token(node.semicolon); |
| 808 } | 808 } |
| 809 | 809 |
| 810 visitLibraryIdentifier(LibraryIdentifier node) { | 810 visitLibraryIdentifier(LibraryIdentifier node) { |
| 811 token(node.beginToken); | 811 visit(node.components.first); |
| 812 for (var component in node.components.skip(1)) { |
| 813 token(component.beginToken.previous); // "." |
| 814 visit(component); |
| 815 } |
| 812 } | 816 } |
| 813 | 817 |
| 814 visitListLiteral(ListLiteral node) { | 818 visitListLiteral(ListLiteral node) { |
| 815 _visitCollectionLiteral( | 819 _visitCollectionLiteral( |
| 816 node, node.leftBracket, node.elements, node.rightBracket); | 820 node, node.leftBracket, node.elements, node.rightBracket); |
| 817 } | 821 } |
| 818 | 822 |
| 819 visitMapLiteral(MapLiteral node) { | 823 visitMapLiteral(MapLiteral node) { |
| 820 _visitCollectionLiteral( | 824 _visitCollectionLiteral( |
| 821 node, node.leftBracket, node.entries, node.rightBracket); | 825 node, node.leftBracket, node.entries, node.rightBracket); |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 /// Gets the 1-based line number that the beginning of [token] lies on. | 1569 /// Gets the 1-based line number that the beginning of [token] lies on. |
| 1566 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber; | 1570 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber; |
| 1567 | 1571 |
| 1568 /// Gets the 1-based line number that the end of [token] lies on. | 1572 /// Gets the 1-based line number that the end of [token] lies on. |
| 1569 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber; | 1573 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber; |
| 1570 | 1574 |
| 1571 /// Gets the 1-based column number that the beginning of [token] lies on. | 1575 /// Gets the 1-based column number that the beginning of [token] lies on. |
| 1572 int _startColumn(Token token) => | 1576 int _startColumn(Token token) => |
| 1573 _lineInfo.getLocation(token.offset).columnNumber; | 1577 _lineInfo.getLocation(token.offset).columnNumber; |
| 1574 } | 1578 } |
| OLD | NEW |