\SassScriptParser
SassScriptParser class.
Parses SassScript. SassScript is lexed into by the SassScriptLexer and
the calculated result returned.
Synopsis
class SassScriptParser
{
- // constants
- const MATCH_INTERPOLATION = '/(?<!\\\\)#\{(.*?)\}/';
- const DEFAULT_ENV = 0;
- const CSS_RULE = 1;
- const CSS_PROPERTY = 2;
- // members
- public static SassContext $context;
- public SassScriptLexer $lexer;
- public static $instance;
- // methods
- public SassScriptParser __construct()
- public string interpolate()
- public SassLiteral evaluate()
- public array parse()
- public static void makeSingular()
Constants
Name | Value |
---|---|
MATCH_INTERPOLATION | '/(?<!\\\\)#\{(.*?)\}/' |
DEFAULT_ENV | 0 |
CSS_RULE | 1 |
CSS_PROPERTY | 2 |
Members
public
- $context — SassContext
-
$instance
Hold a copy of a parser available to the general public. - $lexer — SassScriptLexer
Methods
public
- __construct() — SassScriptParser constructor.
- evaluate() — Evaluate a SassScript.
- interpolate() — Replace interpolated SassScript contained in '#{}' with the parsed value.
- makeSingular() — Reduces a set down to a singular form
- parse() — Parse SassScript to a set of tokens in RPN using the Shunting Yard Algorithm.