| OLD | NEW |
| 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 library yaml.parser; | 5 library yaml.parser; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:source_maps/source_maps.dart'; | 9 import 'package:source_maps/source_maps.dart'; |
| 10 import 'package:string_scanner/string_scanner.dart'; | 10 import 'package:string_scanner/string_scanner.dart'; |
| 11 | 11 |
| 12 import 'equality.dart'; | 12 import 'equality.dart'; |
| 13 import 'model.dart'; | 13 import 'model.dart'; |
| 14 import 'utils.dart'; | 14 import 'utils.dart'; |
| 15 import 'yaml_exception.dart'; | |
| 16 | 15 |
| 17 /// Translates a string of characters into a YAML serialization tree. | 16 /// Translates a string of characters into a YAML serialization tree. |
| 18 /// | 17 /// |
| 19 /// This parser is designed to closely follow the spec. All productions in the | 18 /// This parser is designed to closely follow the spec. All productions in the |
| 20 /// spec are numbered, and the corresponding methods in the parser have the same | 19 /// spec are numbered, and the corresponding methods in the parser have the same |
| 21 /// numbers. This is certainly not the most efficient way of parsing YAML, but | 20 /// numbers. This is certainly not the most efficient way of parsing YAML, but |
| 22 /// it is the easiest to write and read in the context of the spec. | 21 /// it is the easiest to write and read in the context of the spec. |
| 23 /// | 22 /// |
| 24 /// Methods corresponding to productions are also named as in the spec, | 23 /// Methods corresponding to productions are also named as in the spec, |
| 25 /// translating the name of the method (although not the annotation characters) | 24 /// translating the name of the method (although not the annotation characters) |
| (...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 for (var pair in _contents.reversed) { | 1891 for (var pair in _contents.reversed) { |
| 1893 if (pair.first.contains(pos)) return pair.last; | 1892 if (pair.first.contains(pos)) return pair.last; |
| 1894 } | 1893 } |
| 1895 return null; | 1894 return null; |
| 1896 } | 1895 } |
| 1897 | 1896 |
| 1898 /// Associates [value] with [range]. | 1897 /// Associates [value] with [range]. |
| 1899 operator[]=(_Range range, E value) => | 1898 operator[]=(_Range range, E value) => |
| 1900 _contents.add(new Pair<_Range, E>(range, value)); | 1899 _contents.add(new Pair<_Range, E>(range, value)); |
| 1901 } | 1900 } |
| OLD | NEW |