public
|
#
__construct( [type] $lessc, string $sourceName = null )
Constructor
Parameters
- $lessc
[type] - $lessc [description]
- $sourceName
string - $sourceName [description]
|
public
[type]
|
#
parse( string $buffer )
Parse text
Parameters
- $buffer
string - $buffer [description]
Returns
[type] - [description]
|
protected
boolean
|
#
parseChunk( )
Parse a single chunk off the head of the buffer and append it to the current
parse environment. Returns false when the buffer is empty, or when there is an
error.
Parse a single chunk off the head of the buffer and append it to the current
parse environment. Returns false when the buffer is empty, or when there is an
error.
This function is called repeatedly until the entire document is parsed.
This parser is most similar to a recursive descent parser. Single functions
represent discrete grammatical rules for the language, and they are able to
capture the text that represents those rules.
Consider the function lessc::keyword(). (all parse functions are structured
the same)
The function takes a single reference argument. When calling the function it
will attempt to match a keyword on the head of the buffer. If it is successful,
it will place the keyword in the referenced argument, advance the position in
the buffer, and return true. If it fails then it won't advance the buffer and it
will return false.
All of these parse functions are powered by lessc::match(), which behaves the
same way, but takes a literal regular expression. Sometimes it is more
convenient to use match instead of creating a new function.
Because of the format of the functions, to parse an entire string of
grammatical rules, you can chain them together using &&.
But, if some of the rules in the chain succeed before one fails, then the
buffer position will be left at an invalid state. In order to avoid this,
lessc::seek() is used to remember and set buffer positions.
Before parsing a chain, use $s = $this->seek() to remember the current
position into $s. Then if a chain fails, use $this->seek($s) to go back where
we started.
Returns
boolean
|
protected
boolean
|
#
isDirective( string $dirname, [type] $directives )
[isDirective description]
[isDirective description]
Parameters
- $dirname
string - $dirname [description]
- $directives
[type] - $directives [description]
Returns
boolean
|
protected
[type]
|
#
fixTags( [type] $tags )
[fixTags description]
Parameters
- $tags
[type] - $tags [description]
Returns
[type] - [description]
|
protected
boolean
|
#
expressionList( [type] & $exps )
a list of expressions
Parameters
- $exps
[type] - &$exps [description]
Returns
boolean
|
protected
boolean
|
#
expression( string & $out )
Attempt to consume an expression.
Attempt to consume an expression.
Parameters
- $out
string - &$out [description]
Returns
boolean
Link
|
protected
string
|
#
expHelper( type $lhs, type $minP )
Recursively parse infix equation with $lhs at precedence $minP
Recursively parse infix equation with $lhs at precedence $minP
Parameters
- $lhs
type - $lhs [description]
- $minP
type - $minP [description]
Returns
string
|
public
boolean
|
#
propertyValue( [type] & $value, [type] $keyName = null )
Consume a list of values for a property
Consume a list of values for a property
Parameters
- $value
[type] - &$value [description]
- $keyName
[type] - $keyName [description]
Returns
boolean
|
protected
boolean
|
#
parenValue( [type] & $out )
[parenValue description]
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
value( [type] & $value )
a single value
Parameters
- $value
[type] - &$value [description]
Returns
boolean
|
protected
boolean
|
#
import( [type] & $out )
an import statement
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
mediaQueryList( [type] & $out )
[mediaQueryList description]
[mediaQueryList description]
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
[type]
|
#
mediaQuery( [type] & $out )
[mediaQuery description]
Parameters
- $out
[type] - &$out [description]
Returns
[type] - [description]
|
protected
boolean
|
#
mediaExpression( [type] & $out )
[mediaExpression description]
[mediaExpression description]
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
openString( [type] $end, [type] & $out, [type] $nestingOpen = null, [type] $rejectStrs = null )
An unbounded string stopped by $end
An unbounded string stopped by $end
Parameters
- $end
[type] - $end [description]
- $out
[type] - &$out [description]
- $nestingOpen
[type] - $nestingOpen [description]
- $rejectStrs
[type] - $rejectStrs [description]
Returns
boolean
|
protected
boolean
|
#
string( [type] & $out )
[string description]
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
interpolation( [type] & $out )
[interpolation description]
[interpolation description]
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
unit( [type] & $unit )
[unit description]
Parameters
- $unit
[type] - &$unit [description]
Returns
boolean
|
protected
boolean
|
#
color( [type] & $out )
a # color
Parameters
- $out
[type] - &$out [description]
Returns
boolean
|
protected
boolean
|
#
argumentValues( [type] & $args, [type] $delim = ',' )
Consume a list of property values delimited by ; and wrapped in ()
Consume a list of property values delimited by ; and wrapped in ()
Parameters
- $args
[type] - &$args [description]
- $delim
[type] - $delim [description]
Returns
boolean
|
protected
boolean
|
#
argumentDef( [type] & $args, [type] & $isVararg, [type] $delim = ',' )
Consume an argument definition list surrounded by () each argument is a
variable name with optional value or at the end a ... or a variable named
followed by ...
Consume an argument definition list surrounded by () each argument is a
variable name with optional value or at the end a ... or a variable named
followed by ...
Parameters
- $args
[type] - &$args [description]
- $isVararg
[type] - &$isVararg [description]
- $delim
[type] - $delim [description]
Returns
boolean
|
protected
boolean
|
#
tags( [type] & $tags, [type] $simple = false, [type] $delim = ',' )
Consume a list of tags This accepts a hanging delimiter
Consume a list of tags This accepts a hanging delimiter
Parameters
- $tags
[type] - &$tags [description]
- $simple
[type] - $simple [description]
- $delim
[type] - $delim [description]
Returns
boolean
|
protected
boolean
|
#
mixinTags( [type] & $tags )
List of tags of specifying mixin path Optionally separated by > (lazy,
accepts extra >)
List of tags of specifying mixin path Optionally separated by > (lazy,
accepts extra >)
Parameters
- $tags
[type] - &$tags [description]
Returns
boolean
|
protected
boolean
|
#
tagBracket( [type] & $value )
A bracketed value (contained within in a tag definition)
A bracketed value (contained within in a tag definition)
Parameters
- $value
[type] - &$value [description]
Returns
boolean
|
protected
boolean
|
#
tagExpression( [type] & $value )
[tagExpression description]
[tagExpression description]
Parameters
- $value
[type] - &$value [description]
Returns
boolean
|
protected
boolean
|
#
tag( [type] & $tag, boolean $simple = false )
A single tag
Parameters
- $tag
[type] - &$tag [description]
- $simple
boolean - $simple [description]
Returns
boolean
|
protected
boolean
|
#
func( [type] & $func )
A css function
Parameters
- $func
[type] - &$func [description]
Returns
boolean
|
protected
boolean
|
#
variable( [type] & $name )
Consume a less variable
Parameters
- $name
[type] - &$name [description]
Returns
boolean
|
protected
boolean
|
#
assign( string $name = null )
Consume an assignment operator Can optionally take a name that will be set to
the current property name
Consume an assignment operator Can optionally take a name that will be set to
the current property name
Parameters
- $name
string - $name [description]
Returns
boolean
|
protected
boolean
|
#
keyword( [type] & $word )
Consume a keyword
Parameters
- $word
[type] - &$word [description]
Returns
boolean
|
protected
boolean
|
#
end( )
Consume an end of statement delimiter
Consume an end of statement delimiter
Returns
boolean
|
protected
boolean
|
#
guards( [type] & $guards )
[guards description]
Parameters
- $guards
[type] - &$guards [description]
Returns
boolean
|
protected
boolean
|
#
guardGroup( [type] & $guardGroup )
A bunch of guards that are and'd together
A bunch of guards that are and'd together
Parameters
- $guardGroup
[type] - &$guardGroup [description]
Returns
boolean
|
protected
boolean
|
#
guard( [type] & $guard )
[guard description]
Parameters
- $guard
[type] - &$guard [description]
Returns
boolean
|
protected
boolean
|
#
literal( [type] $what, [type] $eatWhitespace = null )
[literal description]
Parameters
- $what
[type] - $what [description]
- $eatWhitespace
[type] - $eatWhitespace [description]
Returns
boolean
|
protected
boolean
|
#
genericList( [type] & $out, [type] $parseItem, string $delim = "", boolean $flatten = true )
[genericList description]
[genericList description]
Parameters
- $out
[type] - &$out [description]
- $parseItem
[type] - $parseItem [description]
- $delim
string - $delim [description]
- $flatten
boolean - $flatten [description]
Returns
boolean
|
protected
boolean
|
#
to( [type] $what, [type] & $out, boolean $until = false, boolean $allowNewline = false )
Advance counter to next occurrence of $what $until - don't include $what in
advance $allowNewline, if string, will be used as valid char set
Advance counter to next occurrence of $what $until - don't include $what in
advance $allowNewline, if string, will be used as valid char set
Parameters
- $what
[type] - $what [description]
- $out
[type] - &$out [description]
- $until
boolean - $until [description]
- $allowNewline
boolean - $allowNewline [description]
Returns
boolean
|
protected
boolean
|
#
match( [type] $regex, [type] & $out, [type] $eatWhitespace = null )
Try to match something on head of buffer
Try to match something on head of buffer
Parameters
- $regex
[type] - $regex [description]
- $out
[type] - &$out [description]
- $eatWhitespace
[type] - $eatWhitespace [description]
Returns
boolean
|
protected
boolean
|
|
protected
boolean
|
#
peek( [type] $regex, [type] & $out = null, [type] $from = null )
Match something without consuming it
Match something without consuming it
Parameters
- $regex
[type] - $regex [description]
- $out
[type] - &$out [description]
- $from
[type] - $from [description]
Returns
boolean
|
protected
boolean
|
#
seek( [type] $where = null )
Seek to a spot in the buffer or return where we are on no argument
Seek to a spot in the buffer or return where we are on no argument
Parameters
- $where
[type] - $where [description]
Returns
boolean
|
public
|
#
throwError( string $msg = "parse error", [type] $count = null )
[throwError description]
Parameters
- $msg
string - $msg [description]
- $count
[type] - $count [description]
|
protected
stdClass
|
#
pushBlock( [type] $selectors = null, [type] $type = null )
[pushBlock description]
Parameters
- $selectors
[type] - $selectors [description]
- $type
[type] - $type [description]
Returns
|
protected
stdClass
|
#
pushSpecialBlock( [type] $type )
Push a block that doesn't multiply tags
Push a block that doesn't multiply tags
Parameters
- $type
[type] - $type [description]
Returns
|
protected
|
#
append( [type] $prop, [type] $pos = null )
Append a property to the current block
Append a property to the current block
Parameters
- $prop
[type] - $prop [description]
- $pos
[type] - $pos [description]
|
protected
[type]
|
#
pop( )
Pop something off the stack
Pop something off the stack
Returns
[type] - [description]
|