type
constructors
methods
find |
Scan until we find the given |
---|---|
findMatch |
Consume characters until the given function returns true, or the end-of-line is reached. |
hasNext |
Are there more characters to consume |
match |
Consume characters while the given function returns |
matchMultiple |
Consume as many |
next |
Advance the scanner to the next character |
nextCh |
Check if the specified char is next and advance the position. |
nextStr |
Check if we have the specified content on the line and advance the position. |
peek |
Peek at the next character without consuming it |
peekCodePoint |
Peek at the next code point |
peekPrevCodePoint |
Peek at the previous codepoint |
pos |
Get the current position (current line, index into that line) |
setPos |
Set the current position for the scanner |
source |
For cases where the caller appends the result to a StrBuf, we could offer another method to avoid some unnecessary copying. |
whitespace |
Consume whitespace and return the number of whitespace characters consumed |
Slot Details
find
findMatch
hasNext
make
src
new make(SourceLine[] lines, Int lineIndex := 0, Int index := 0)
makeLine
src
new makeLine(SourceLine line)
makeSourceLines
src
new makeSourceLines(SourceLines sourceLines)
match
matchMultiple
next
nextCh
nextStr
Check if we have the specified content on the line and advance the position. Note that if you want to match newline characters, use nextCh
.
content
: the text content to match on a single line (excluding newline)
Return true if matched and position was advanced; false otherwise
peek
peekCodePoint
peekPrevCodePoint
pos
setPos
source
src
SourceLines source(Position begin, Position end)
For cases where the caller appends the result to a StrBuf, we could offer another method to avoid some unnecessary copying.