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

Side by Side Diff: frog/source.dart

Issue 8498020: Beginning of CSS parser using frog parsering infrastructure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor cleanup. Created 9 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
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 // TODO(jimhug): This should be an interface to work better with tools. 5 // TODO(jimhug): This should be an interface to work better with tools.
6 /** 6 /**
7 * Represents a file of source code. 7 * Represents a file of source code.
8 */ 8 */
9 class SourceFile implements Comparable { 9 class SourceFile implements Comparable {
10 // TODO(terry): This filename for in memory buffer. May need to rework if
11 // filename is used for more than informational.
12 static String IN_MEMORY_FILE = '<buffer>';
13
10 /** The name of the file. */ 14 /** The name of the file. */
11 final String filename; 15 final String filename;
12 16
13 /** The text content of the file. */ 17 /** The text content of the file. */
14 String _text; 18 String _text;
15 19
16 /** 20 /**
17 * The order of the source file in a given library. This is used while we're 21 * The order of the source file in a given library. This is used while we're
18 * writing code for a library. A single source file can be used 22 * writing code for a library. A single source file can be used
19 */ 23 */
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 149
146 /** Compares two source spans by file and position. Handles nulls. */ 150 /** Compares two source spans by file and position. Handles nulls. */
147 int compareTo(SourceSpan other) { 151 int compareTo(SourceSpan other) {
148 if (file == other.file) { 152 if (file == other.file) {
149 int d = start - other.start; 153 int d = start - other.start;
150 return d == 0 ? (end - other.end) : d; 154 return d == 0 ? (end - other.end) : d;
151 } 155 }
152 return file.compareTo(other.file); 156 return file.compareTo(other.file);
153 } 157 }
154 } 158 }
OLDNEW
« no previous file with comments | « frog/presubmit.py ('k') | utils/css/css.dart » ('j') | utils/css/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698