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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/scanner/array_based_scanner.dart

Issue 11092101: Diagnose unbalanced parentheses better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/scanner/listener.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) 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 part of scanner_implementation; 5 part of scanner_implementation;
6 6
7 abstract 7 abstract
8 class ArrayBasedScanner<S extends SourceString> extends AbstractScanner<S> { 8 class ArrayBasedScanner<S extends SourceString> extends AbstractScanner<S> {
9 int get charOffset => byteOffset + extraCharOffset; 9 int get charOffset => byteOffset + extraCharOffset;
10 final Token tokens; 10 final Token tokens;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 tail = tail.next; 61 tail = tail.next;
62 } 62 }
63 63
64 void appendEofToken() { 64 void appendEofToken() {
65 tail.next = new Token(EOF_INFO, charOffset); 65 tail.next = new Token(EOF_INFO, charOffset);
66 tail = tail.next; 66 tail = tail.next;
67 // EOF points to itself so there's always infinite look-ahead. 67 // EOF points to itself so there's always infinite look-ahead.
68 tail.next = tail; 68 tail.next = tail;
69 discardOpenLt(); 69 discardOpenLt();
70 while (!groupingStack.isEmpty) { 70 while (!groupingStack.isEmpty) {
71 BeginGroupToken begin = groupingStack.head; 71 unmatchedBeginGroup(groupingStack.head);
72 begin.endGroup = tail;
73 groupingStack = groupingStack.tail; 72 groupingStack = groupingStack.tail;
74 } 73 }
75 } 74 }
76 75
77 void beginToken() { 76 void beginToken() {
78 tokenStart = charOffset; 77 tokenStart = charOffset;
79 } 78 }
80 79
81 Token firstToken() { 80 Token firstToken() {
82 return tokens.next; 81 return tokens.next;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void discardOpenLt() { 175 void discardOpenLt() {
177 while (!groupingStack.isEmpty 176 while (!groupingStack.isEmpty
178 && identical(groupingStack.head.kind, LT_TOKEN)) { 177 && identical(groupingStack.head.kind, LT_TOKEN)) {
179 groupingStack = groupingStack.tail; 178 groupingStack = groupingStack.tail;
180 } 179 }
181 } 180 }
182 181
183 // TODO(ahe): make class abstract instead of adding an abstract method. 182 // TODO(ahe): make class abstract instead of adding an abstract method.
184 peek(); 183 peek();
185 } 184 }
OLDNEW
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698