\FOFLessParser
This class is taken verbatim from:
lessphp v0.3.9
http://leafo.net/lessphp
LESS css compiler, adapted from http://lesscss.org
Copyright 2012, Leaf Corcoran <leafot@gmail.com>
Licensed under MIT or GPLv3, see LICENSE
Responsible for taking a string of LESS code and converting it into a syntax tree
Synopsis
class FOFLessParser
{
- // members
- protected $nextBlockId;
- protected $precedence;
- protected $whitePattern;
- protected $commentMulti;
- protected $commentSingle;
- protected $commentMultiLeft;
- protected $commentMultiRight;
- protected $operatorString;
- protected $supressDivisionProps;
- protected $blockDirectives;
- protected $lineDirectives;
- protected $inParens;
- protected $literalCache;
- // methods
- public void __construct()
- public [type] parse()
- protected boolean parseChunk()
- protected boolean isDirective()
- protected [type] fixTags()
- protected boolean expressionList()
- protected boolean expression()
- protected string expHelper()
- public boolean propertyValue()
- protected boolean parenValue()
- protected boolean value()
- protected boolean import()
- protected boolean mediaQueryList()
- protected [type] mediaQuery()
- protected boolean mediaExpression()
- protected boolean openString()
- protected boolean string()
- protected boolean interpolation()
- protected boolean unit()
- protected boolean color()
- protected boolean argumentValues()
- protected boolean argumentDef()
- protected boolean tags()
- protected boolean mixinTags()
- protected boolean tagBracket()
- protected boolean tagExpression()
- protected boolean tag()
- protected boolean func()
- protected boolean variable()
- protected boolean assign()
- protected boolean keyword()
- protected boolean end()
- protected boolean guards()
- protected boolean guardGroup()
- protected boolean guard()
- protected boolean literal()
- protected boolean genericList()
- protected boolean to()
- protected boolean match()
- protected boolean whitespace()
- protected boolean peek()
- protected boolean seek()
- public void throwError()
- protected stdClass pushBlock()
- protected stdClass pushSpecialBlock()
- protected void append()
- protected [type] pop()
- protected [type] removeComments()
Tasks
Tasks
Line | Task |
---|---|
146 | report where the block was opened |
412 | cache pattern in parser |
1738+ | rename to guardGroup |
2056 | this depends on $this->count |
2083 | kill me from here |
2147+ | : make it work for all functions, not just url |
Members
protected
- $blockDirectives
- $commentMulti
- $commentMultiLeft
- $commentMultiRight
- $commentSingle
-
$inParens
if we are in parens we can be more liberal with whitespace around operators because it must evaluate to a single value and thus is less ambiguous. - $lineDirectives
- $literalCache
- $nextBlockId
- $operatorString
- $precedence
- $supressDivisionProps
- $whitePattern
Methods
protected
- append() — Append a property to the current block
- argumentDef() — 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 ...
- argumentValues() — Consume a list of property values delimited by ; and wrapped in ()
- assign() — Consume an assignment operator Can optionally take a name that will be set to the current property name
- color() — a # color
- end() — Consume an end of statement delimiter
- expHelper() — Recursively parse infix equation with $lhs at precedence $minP
- expression() — Attempt to consume an expression.
- expressionList() — a list of expressions
- fixTags() — [fixTags description]
- func() — A css function
- genericList() — [genericList description]
- guard() — [guard description]
- guardGroup() — A bunch of guards that are and'd together
- guards() — [guards description]
- import() — an import statement
- interpolation() — [interpolation description]
- isDirective() — [isDirective description]
- keyword() — Consume a keyword
- literal() — [literal description]
- match() — Try to match something on head of buffer
- mediaExpression() — [mediaExpression description]
- mediaQuery() — [mediaQuery description]
- mediaQueryList() — [mediaQueryList description]
- mixinTags() — List of tags of specifying mixin path Optionally separated by > (lazy, accepts extra >)
- openString() — An unbounded string stopped by $end
- parenValue() — [parenValue description]
- parseChunk() — Parse a single chunk off the head of the buffer and append it to the current parse environment.
- peek() — Match something without consuming it
- pop() — Pop something off the stack
- pushBlock() — [pushBlock description]
- pushSpecialBlock() — Push a block that doesn't multiply tags
- removeComments() — Remove comments from $text
- seek() — Seek to a spot in the buffer or return where we are on no argument
- string() — [string description]
- tag() — A single tag
- tagBracket() — A bracketed value (contained within in a tag definition)
- tagExpression() — [tagExpression description]
- to() — Advance counter to next occurrence of $what $until - don't include $what in advance $allowNewline, if string, will be used as valid char set
- unit() — [unit description]
- value() — a single value
- variable() — Consume a less variable
- whitespace() — Watch some whitespace
public
- __construct() — Constructor
- parse() — Parse text
- propertyValue() — Consume a list of values for a property
- throwError() — [throwError description]