LineScanner class

A subclass of StringScanner that tracks line and column information.

Inheritance
Implementers

Constructors

LineScanner(String string, {Object? sourceUrl, int? position})

Properties

column int
The scanner's current (zero-based) column number.
no setter
hashCode int
The hash code for this object.
no setterinherited
isDone bool
Whether the scanner has completely consumed string.
no setterinherited
lastMatch Match?
The data about the previous match made by the scanner.
no setterinherited
line int
The scanner's current (zero-based) line number.
no setter
position int
The current position of the scanner in the string, in characters.
getter/setter pairinherited-getteroverride-setter
rest String
The portion of the string that hasn't yet been scanned.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceUrl Uri?
The URL of the source of the string being scanned.
finalinherited
state LineScannerState
The scanner's state, including line and column information.
getter/setter pair
string String
The string being scanned through.
finalinherited

Methods

error(String message, {Match? match, int? position, int? length}) → Never
Throws a FormatException with message as well as a detailed description of the location of the error in the string.
inherited
expect(Pattern pattern, {String? name}) → void
If pattern matches at the current position of the string, scans forward until the end of the match.
inherited
expectChar(int character, {String? name}) → void
If the next character in the string is character, consumes it.
inherited
expectDone() → void
If the string has not been fully consumed, this throws a FormatException.
inherited
matches(Pattern pattern) bool
Returns whether or not pattern matches at the current position of the string.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peekChar([int? offset]) int?
Returns the character code of the character offset away from position.
inherited
peekCodePoint() int?
Returns the Unicode code point immediately after position.
inherited
readChar() int
Consumes a single character and returns its character code.
override
readCodePoint() int
Consumes a single Unicode code unit and returns it.
inherited
scan(Pattern pattern) bool
If pattern matches at the current position of the string, scans forward until the end of the match.
override
scanChar(int character) bool
If the next character in the string is character, consumes it.
override
substring(int start, [int? end]) String
Returns the substring of string between start and end.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited