string_scanner
A class for parsing strings using a sequence of patterns.
1.4.1
9.3M downloads/mo
#38 most downloaded on pub.dev
dart-lang/tools
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 1.7 years
Nearly every release is documented
notes for 23 of 24 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
28 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
28 releases · Apr 2014 to Dec 2024Releases
latest 28-
1.4.117 Dec 2024 -
1.4.016 Oct 2024Release notes
Open source →- Fix
LineScanner's handling of\r\n's to preventing errors scanning zero-length matches when between CR and LF. CR is treated as a new line only if not immediately followed by a LF. - Fix
LineScanner's updating ofcolumnwhen settingpositionif the current position is not0.
- Fix
-
1.3.011 Jul 2024Release notes
Open source →-
Require Dart 3.1.0
-
Add a
SpanScanner.spanFromPosition()method which takes raw code units rather thanSpanScanner.spanFrom()'sLineScannerStates.
-
-
1.2.031 Oct 2022Release notes
Open source →-
Require Dart 2.18.0
-
Add better support for reading code points in the Unicode supplementary plane:
-
Added
StringScanner.readCodePoint(), which consumes an entire Unicode code point even if it's represented by two UTF-16 code units. -
Added
StringScanner.peekCodePoint(), which returns an entire Unicode code point even if it's represented by two UTF-16 code units. -
StringScanner.scanChar()andStringScanner.expectChar()will now properly consume two UTF-16 code units if they're passed Unicode code points in the supplementary plane.
-
-
-
1.1.112 May 2022Release notes
Open source →- Populate the pubspec
repositoryfield. - Switch to
package:lints. - Remove a dependency on
package:charcode.
- Populate the pubspec
-
1.1.002 Feb 2021 -
1.1.0-nullsafety.303 Nov 2020 pre-releaseRelease notes
Open source →- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
- Update SDK constraints to
-
1.1.0-nullsafety.223 Oct 2020 pre-release -
1.1.0-nullsafety.122 Sep 2020 pre-release -
1.1.0-nullsafety29 Jul 2020 pre-release -
1.0.531 Jul 2019 -
1.0.413 Aug 2018 -
1.0.318 Jul 2018 -
1.0.222 May 2017Release notes
Open source →SpanScannerno longer crashes when creating a span that contains a UTF-16 surrogate pair.
-
1.0.102 Nov 2016 -
1.0.014 Jun 2016Release notes
Open source →-
Breaking change:
StringScanner.error()'slengthargument now defaults to0rather than1when no match data is available. -
Breaking change:
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.0are 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". -
-
0.1.506 Jun 2016Release notes
Open source →-
Add
new SpanScanner.within(), which scans within a existingFileSpan. -
Add
StringScanner.scanChar()andStringScanner.expectChar().
-
-
0.1.402 Sep 2015Release notes
Open source →- Add
new SpanScanner.eager()for creating aSpanScannerthat eagerly computes its current line and column numbers.
- Add
-
0.1.4+115 Jan 2016 -
0.1.312 Dec 2014 -
0.1.3+130 Mar 2015 -
0.1.3+202 Sep 2015Release notes
Open source →- Fix
LineScanner's handling of carriage returns to match that ofSpanScanner.
- Fix
-
0.1.205 Nov 2014Release notes
Open source →- Add
StringScanner.substring, which returns a substring of the source string.
- Add
-
0.1.129 Oct 2014Release notes
Open source →-
Declare
SpanScanner's exposedSourceSpans andSourceLocations to beFileSpans andFileLocations. They always were underneath, but callers may now rely on it. -
Add
SpanScanner.location, which returns the scanner's currentSourceLocation.
-
-
0.1.024 Jul 2014Release notes
Open source →-
Switch from
source_maps'Spanclass tosource_span'sSourceSpanclass. -
new StringScanner()'ssourceUrlparameter is now named to make it clear that it can be safelynull. -
new StringScannerException()takes different arguments in a different order to matchSpanFormatException. -
StringScannerException.stringhas been renamed toStringScannerException.sourceto match theFormatExceptioninterface.
-
-
0.0.323 Jun 2014Release notes
Open source →- Make
StringScannerExceptioninherit from source_map'sSpanFormatException.
- Make
-
0.0.230 May 2014Release notes
Open source →-
new StringScanner()now takes an optionalsourceUrlargument that provides the URL of the source file. This is used for error reporting. -
Add
StringScanner.readChar()andStringScanner.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. -
Add a
LineScannersubclass ofStringScannerthat automatically tracks line and column information of the text being scanned. -
Add a
SpanScannersubclass ofLineScannerthat exposes matched ranges as [source map][]Spanobjects.
-
-
0.0.102 Apr 2014Nothing published for this version