Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /** | 5 /** |
| 6 * Base class for simple recursive descent parsers. | 6 * Base class for simple recursive descent parsers. |
| 7 * Handles the lower level stuff, i.e. what a scanner/tokenizer would do. | 7 * Handles the lower level stuff, i.e. what a scanner/tokenizer would do. |
| 8 */ | 8 */ |
| 9 class _Parser { | 9 class _Parser { |
| 10 static final WHITESPACE = ' \r\n\t'; | 10 static final WHITESPACE = ' \r\n\t'; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 while ((name = _maybeEatString()) != null) { | 370 while ((name = _maybeEatString()) != null) { |
| 371 _lineNames[name] = _tracks.length + 1; // should be 1-based | 371 _lineNames[name] = _tracks.length + 1; // should be 1-based |
| 372 } | 372 } |
| 373 | 373 |
| 374 _maybeEatWhitespace(); | 374 _maybeEatWhitespace(); |
| 375 if (endOfInput) { | 375 if (endOfInput) { |
| 376 return; | 376 return; |
| 377 } | 377 } |
| 378 | 378 |
| 379 if (resultTracks != null) { | 379 if (resultTracks != null) { |
| 380 if (_peekChar() == R_PAREN) { | 380 if (_peekChar() == _Parser.R_PAREN) { |
|
ahe
2012/06/27 10:44:02
Static methods are not inherited. See this test fo
| |
| 381 return; | 381 return; |
| 382 } | 382 } |
| 383 resultTracks.add(new GridTrack(_parseTrackMinmax())); | 383 resultTracks.add(new GridTrack(_parseTrackMinmax())); |
| 384 } else { | 384 } else { |
| 385 _parseTrackGroup(); | 385 _parseTrackGroup(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 _maybeEatWhitespace(); | 388 _maybeEatWhitespace(); |
| 389 } | 389 } |
| 390 } | 390 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 String toString() { | 477 String toString() { |
| 478 String location; | 478 String location; |
| 479 if (_offset < _source.length) { | 479 if (_offset < _source.length) { |
| 480 location = 'location: ' + _source.substring(_offset); | 480 location = 'location: ' + _source.substring(_offset); |
| 481 } else { | 481 } else { |
| 482 location = 'end of input'; | 482 location = 'end of input'; |
| 483 } | 483 } |
| 484 return 'SyntaxErrorException: $_message at $location'; | 484 return 'SyntaxErrorException: $_message at $location'; |
| 485 } | 485 } |
| 486 } | 486 } |
| OLD | NEW |