string_scanner 1.2.0 string_scanner: ^1.2.0 copied to clipboard
A class for parsing strings using a sequence of patterns.
Require Dart 2.18.0
Add better support for reading code points in the Unicode supplementary plane:
StringScanner.readCodePoint(), which consumes an entire Unicode code point even if it's represented by two UTF-16 code units.
StringScanner.peekCodePoint(), which returns an entire Unicode code point even if it's represented by two UTF-16 code units.
StringScanner.expectChar()will now properly consume two UTF-16 code units if they're passed Unicode code points in the supplementary plane.
- Populate the pubspec
- Switch to
- Remove a dependency on
- Stable release for null safety.
- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
- Allow prerelease versions of the 2.12 sdk.
- Allow 2.10 stable and 2.11.0 dev SDK versions.
- Migrate to null safety.
Added an example.
Update Dart SDK constraint to
- Add @alwaysThrows annotation to error method.
- Set max SDK version to
<3.0.0, and adjust other dependencies.
SpanScannerno longer crashes when creating a span that contains a UTF-16 surrogate pair.
- Fix the error text emitted by
lengthargument now defaults to
1when no match data is available.
StringScanner.lastMatchand related methods are now reset when the scanner's position changes without producing a new match.
Note: While the changes in
1.0.0 are user-visible, they're unlikely to
actually break any code in practice. Unless you know that your package is
incompatible with 0.1.x, consider using 0.1.5 as your lower bound rather
than 1.0.0. For example,
string_scanner: ">=0.1.5 <2.0.0".
new SpanScanner.within(), which scans within a existing
- Remove the dependency on
path, since we don't actually import it.
new SpanScanner.eager()for creating a
SpanScannerthat eagerly computes its current line and column numbers.
LineScanner's handling of carriage returns to match that of
- Fixed the homepage URL.
- Add an optional
StringScanner.substring, which returns a substring of the source string.
SourceLocations to be
FileLocations. They always were underneath, but callers may now rely on it.
SpanScanner.location, which returns the scanner's current
sourceUrlparameter is now named to make it clear that it can be safely
new StringScannerException()takes different arguments in a different order to match
StringScannerException.stringhas been renamed to
StringScannerException.sourceto match the
StringScannerExceptioninherit from source_map's
new StringScanner()now takes an optional
sourceUrlargument that provides the URL of the source file. This is used for error reporting.
StringScanner.peekChar()methods for doing character-by-character scanning.
Scanners now throw
StringScannerExceptions which provide more detailed access to information about the errors that were thrown and can provide terminal-colored messages.
StringScannerthat automatically tracks line and column information of the text being scanned.
LineScannerthat exposes matched ranges as [source map]