Line data Source code
1 : // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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. 4 : 5 : import 'package:source_span/source_span.dart'; 6 : 7 : import 'string_scanner.dart'; 8 : 9 : /// An exception thrown by a [StringScanner] that failed to parse a string. 10 : class StringScannerException extends SourceSpanFormatException { 11 0 : @override 12 0 : String get source => super.source as String; 13 : 14 : /// The URL of the source file being parsed. 15 : /// 16 : /// This may be `null`, indicating that the source URL is unknown. 17 0 : Uri? get sourceUrl => span?.sourceUrl; 18 : 19 0 : StringScannerException(String message, SourceSpan span, String source) 20 0 : : super(message, span, source); 21 : }