Method |
Description |
|
consume ( integer | null $length = null ) |
Consumes a length or the length of the last peeked string. |
|
consumeMatch ( ) |
Consumes a match previously read and matched by ->match(). |
|
createToken ( string $type ) : array |
Creates a new token. |
|
getMatch ( integer | string $index ) : mixed | null |
Gets a match from the last ->match() call |
|
isAtEnd ( ) : boolean |
Checks if our read pointer is at the end of the code. |
|
match ( string $pattern, string $modifiers = '' ) : boolean |
Matches a pattern against the start of the current $input. |
|
peek ( integer $length = 1 ) : string |
Shows the next characters in our input. |
|
read ( callable $callback, integer $length = 1 ) : string |
Peeks and consumes chars until the passed callback returns false. |
|
readBracketContents ( array $breakChars = null ) : string |
Reads a "value", 'value' or value style string really gracefully. |
|
readSpaces ( ) : string |
Reads all TAB (\t) and SPACE ( ) chars until something else is found. |
|
scanAssignment ( ) : Generator |
Scans for an -token (begins with ampersand (&)). |
|
scanAttributes ( ) : Generator |
Scans for an attribute-block. |
|
scanBlock ( ) : Generator |
Scans for -tokens. |
|
scanCase ( ) : Generator |
Scans for a -token. |
|
scanClasses ( ) : Generator |
Scans for a -token (begins with dot (.)). |
|
scanCode ( ) : Generator |
Scans for a code-block initiated with a dash (-) character. |
|
scanComment ( ) : Generator |
Scans for //-? comments yielding a
token if found as well as a stack of text-block tokens. |
|
scanConditional ( ) : Generator |
Scans for a -token. |
|
scanControlStatement ( string $type, array $names, string | null $nameAttribute = null ) : Generator |
Scans for a control-statement-kind of token. |
|
scanDo ( ) : Generator |
Scans for a -token. |
|
scanDoctype ( ) : Generator |
Scans for a -token. |
|
scanEach ( ) : Generator |
Scans for an -token. |
|
scanExpansion ( ) : Generator |
Scans for a -token. |
|
scanExpression ( ) : Generator |
Scans for !=-style expression. |
|
scanFilter ( ) : Generator |
Scans for :-style filters and yields
a token if found. |
|
scanFor ( array $scans, boolean | false $throwException = false ) : Generator |
Keeps scanning for all types of tokens passed as the first argument. |
|
scanForLoop ( ) : Generator |
Scans for a -token. |
|
scanId ( ) : Generator |
Scans for a -token (begins with hash (#)). |
|
scanImport ( ) : Generator |
Scans for imports and yields an -token if found. |
|
scanIndent ( ) : Generator | void |
Scans for indentation and automatically keeps
the $_level updated through all tokens. |
|
scanMarkup ( ) : Generator |
Scans for HTML-markup based on a starting '<'. |
|
scanMixin ( ) : Generator |
Scans for a mixin definition token (). |
|
scanMixinCall ( ) : Generator |
Scans for a -token (begins with plus (+)). |
|
scanNewLine ( ) : Generator |
Scans for a new-line character and yields a -token if found. |
|
scanSub ( ) : Generator |
Scans sub-expressions of elements, e.g. a text-block
initiated with a dot (.) or a block expansion. |
|
scanTag ( ) : Generator |
Scans for a -token. |
|
scanText ( boolean $escaped = false ) : Generator |
Scans for text until the end of the current line
and yields a -token if found. |
|
scanTextBlock ( $escaped = false ) : Generator |
Scans for text and keeps scanning text, if you indent once
until it is outdented again (e.g. .-text-blocks, expressions, comments). |
|
scanTextLine ( ) : Generator |
Scans for a |-style text-line and yields it along
with a text-block, if it has any. |
|
scanToken ( string $type, string $pattern, string $modifiers = '' ) : Generator |
Scans for a specific token-type based on a pattern
and converts it to a valid token automatically. |
|
scanVariable ( ) : Generator |
Scans for a -token. |
|
scanWhen ( ) : Generator |
Scans for a -token. |
|
scanWhile ( ) : Generator |
Scans for a -token. |
|
strlen ( string $string ) : integer |
mb_* compatible version of PHP's strlen. |
|
strpos ( string $haystack, string $needle, integer | null $offset = null ) : integer | false |
mb_* compatible version of PHP's strpos. |
|
substr ( string $string, integer $start, integer | null $range = null ) : string |
mb_* compatible version of PHP's substr. |
|
substr_count ( string $haystack, string $needle ) : integer |
mb_* compatible version of PHP's substr_count. |
|
throwException ( string $message ) |
Throws a lexer-exception. |
|