Method |
Description |
|
__construct ( string $line ) |
|
|
advance ( ) |
Move the cursor forwards |
|
advanceBy ( integer $characters, $advanceByColumns = false ) |
Move the cursor forwards |
|
advanceBySpaceOrTab ( ) : boolean |
Advances the cursor by a single space or tab, if present |
|
advanceToEnd ( ) : integer |
Move the position to the very end of the line |
|
advanceToFirstNonSpace ( ) : integer |
Parse zero or more space characters, including at most one newline |
|
advanceWhileMatches ( string $character, integer | null $maximumCharactersToAdvance = null ) : integer |
Advances the cursor while the given character is matched |
|
getCharacter ( integer | null $index = null ) : string | null |
|
|
getColumn ( ) : integer |
|
|
getFirstNonSpaceCharacter ( ) : string |
Returns the next character which isn't a space |
|
getFirstNonSpacePosition ( ) : integer |
Returns the position of the next non-space character |
|
getIndent ( ) : integer |
Calculates the current indent (number of spaces after current position) |
|
getLine ( ) : string |
|
|
getPosition ( ) : integer |
|
|
getPreviousText ( ) : string |
|
|
getRemainder ( ) : string |
|
|
isAtEnd ( ) : boolean |
|
|
isBlank ( ) : boolean |
Whether the remainder is blank |
|
isIndented ( ) : boolean |
Whether the cursor is indented to INDENT_LEVEL |
|
match ( string $regex ) : string | null |
Try to match a regular expression |
|
peek ( integer $offset = 1 ) : string | null |
Returns the next character (or null, if none) without advancing forwards |
|
restoreState ( CursorState $state ) |
|
|
saveState ( ) : CursorState |
|
|