Import std.text.scanner
std.text.scanner
Scanner: reads text from its start, a character, a word, a line, or a number at a time, for a parser, and keeps the Line and Column of what it reads next, where an error can point. A line ends at "\n", and a column counts characters, code points, from 1.
std/text/scanner.fb
Types
Scanner
class
Public Class Scanner
Reads text from its start, a character, a word, a line, or a number at a time, keeping the Line and Column of what it reads next.
-
The text it reads.
-
One that reads
textfrom its start. -
The position of the next character it reads, a byte offset in Text.
-
The line of the next character it reads, from 1.
-
The column of the next character it reads, from 1, counting characters.
-
Whether it has read all of Text.
-
The next character, without reading it, or Null at the end.
-
Reads the next character, and gives it, or Null at the end.
-
Reads
textwhen it comes next, and gives whether it did. -
Reads the characters
keepsays to, up to the first it doesn't, and gives them. -
Reads the whitespace that comes next, up to the first other character.
-
Reads up to
text, or to the end whentextdoesn't come, and gives what it read, withouttext, which comes next. -
Reads the rest of the line and its line break, "\n" or "\r\n", and gives the line without it, or Null at the end. The last line, with no "\n" after it, is all of what's left.
-
Reads the whitespace that comes next and the word after it, the characters up to the next whitespace, and gives the word, or Null when only whitespace is left.
-
Reads an integer that comes next: a "-" or "+", or neither, then the digits 0 to 9, and gives it, or Null, reading nothing, when no digit comes or it doesn't fit in an Int64.
-
Reads the rest of Text, and gives it.
Report an issue with this page or with FutureBlitz on GitHub.