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

Side by Side Diff: pkg/kernel/lib/ast.dart

Issue 2704753002: Implement line and column numbers. (Closed)
Patch Set: Change message. Created 3 years, 10 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 | « pkg/front_end/test/fasta/kompile.status ('k') | utils/kernel-service/kernel-service.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// ----------------------------------------------------------------------- 5 /// -----------------------------------------------------------------------
6 /// ERROR HANDLING 6 /// ERROR HANDLING
7 /// ----------------------------------------------------------------------- 7 /// -----------------------------------------------------------------------
8 /// 8 ///
9 /// As a rule of thumb, errors that can be detected statically are handled by 9 /// As a rule of thumb, errors that can be detected statically are handled by
10 /// the frontend, typically by translating the erroneous code into a 'throw' or 10 /// the frontend, typically by translating the erroneous code into a 'throw' or
(...skipping 3591 matching lines...) Expand 10 before | Expand all | Expand 10 after
3602 /// Given a source file uri and a offset in that file one can translate 3602 /// Given a source file uri and a offset in that file one can translate
3603 /// it to a line:column position in that file. 3603 /// it to a line:column position in that file.
3604 final Map<String, Source> uriToSource; 3604 final Map<String, Source> uriToSource;
3605 3605
3606 /// Reference to the main method in one of the libraries. 3606 /// Reference to the main method in one of the libraries.
3607 Procedure mainMethod; 3607 Procedure mainMethod;
3608 3608
3609 Program([List<Library> libraries, Map<String, Source> uriToSource]) 3609 Program([List<Library> libraries, Map<String, Source> uriToSource])
3610 : libraries = libraries ?? <Library>[], 3610 : libraries = libraries ?? <Library>[],
3611 uriToSource = uriToSource ?? <String, Source>{} { 3611 uriToSource = uriToSource ?? <String, Source>{} {
3612 setParents(libraries, this); 3612 setParents(this.libraries, this);
3613 } 3613 }
3614 3614
3615 accept(TreeVisitor v) => v.visitProgram(this); 3615 accept(TreeVisitor v) => v.visitProgram(this);
3616 3616
3617 visitChildren(Visitor v) { 3617 visitChildren(Visitor v) {
3618 visitList(libraries, v); 3618 visitList(libraries, v);
3619 mainMethod?.acceptReference(v); 3619 mainMethod?.acceptReference(v);
3620 } 3620 }
3621 3621
3622 transformChildren(Transformer v) { 3622 transformChildren(Transformer v) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 } 3745 }
3746 } 3746 }
3747 } 3747 }
3748 3748
3749 class Source { 3749 class Source {
3750 final List<int> lineStarts; 3750 final List<int> lineStarts;
3751 final String source; 3751 final String source;
3752 3752
3753 Source(this.lineStarts, this.source); 3753 Source(this.lineStarts, this.source);
3754 } 3754 }
OLDNEW
« no previous file with comments | « pkg/front_end/test/fasta/kompile.status ('k') | utils/kernel-service/kernel-service.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698