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

Side by Side Diff: utils/pub/yaml/parser.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 | « utils/pub/io.dart ('k') | utils/template/codegen.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 * Translates a string of characters into a YAML serialization tree. 6 * Translates a string of characters into a YAML serialization tree.
7 * 7 *
8 * This parser is designed to closely follow the spec. All productions in the 8 * This parser is designed to closely follow the spec. All productions in the
9 * spec are numbered, and the corresponding methods in the parser have the same 9 * spec are numbered, and the corresponding methods in the parser have the same
10 * numbers. This is certainly not the most efficient way of parsing YAML, but it 10 * numbers. This is certainly not the most efficient way of parsing YAML, but it
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 if (isBreak(char)) { 195 if (isBreak(char)) {
196 line++; 196 line++;
197 column = 0; 197 column = 0;
198 } else { 198 } else {
199 column++; 199 column++;
200 } 200 }
201 201
202 if (farthestLine < line) { 202 if (farthestLine < line) {
203 farthestLine = line; 203 farthestLine = line;
204 farthestColumn = column; 204 farthestColumn = column;
205 farthestContext = contextStack.last(); 205 farthestContext = contextStack.last;
206 } else if (farthestLine == line && farthestColumn < column) { 206 } else if (farthestLine == line && farthestColumn < column) {
207 farthestColumn = column; 207 farthestColumn = column;
208 farthestContext = contextStack.last(); 208 farthestContext = contextStack.last;
209 } 209 }
210 farthestPos = pos; 210 farthestPos = pos;
211 211
212 return char; 212 return char;
213 } 213 }
214 214
215 /** 215 /**
216 * Returns the character at the current position, or the character [i] 216 * Returns the character at the current position, or the character [i]
217 * characters after the current position. 217 * characters after the current position.
218 * 218 *
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 var pair = contents[i]; 1990 var pair = contents[i];
1991 if (pair.first.contains(pos)) return pair.last; 1991 if (pair.first.contains(pos)) return pair.last;
1992 } 1992 }
1993 return null; 1993 return null;
1994 } 1994 }
1995 1995
1996 /** Associates [value] with [range]. */ 1996 /** Associates [value] with [range]. */
1997 operator[]=(_Range range, E value) => 1997 operator[]=(_Range range, E value) =>
1998 contents.add(new _Pair<_Range, E>(range, value)); 1998 contents.add(new _Pair<_Range, E>(range, value));
1999 } 1999 }
OLDNEW
« no previous file with comments | « utils/pub/io.dart ('k') | utils/template/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698