\SassParser
SassParser class.
Parses files.
Synopsis
class SassParser
{
- // constants
- const BEGIN_COMMENT = '/';
- const BEGIN_CSS_COMMENT = '/*';
- const END_CSS_COMMENT = '*/';
- const BEGIN_SASS_COMMENT = '//';
- const BEGIN_INTERPOLATION = '#';
- const BEGIN_INTERPOLATION_BLOCK = '#{';
- const BEGIN_BLOCK = '{';
- const END_BLOCK = '}';
- const END_STATEMENT = ';';
- const DOUBLE_QUOTE = '"';
- const SINGLE_QUOTE = "'";
- // members
- public static $instance;
- public $indentChar;
- public array $indentChars = ;
- public integer $indentSpaces = 2;
- public $source;
- public $basepath;
- public $debug_info;
- public $filename;
- public static An $functions;
- public $line;
- public $line_numbers;
- public $load_paths;
- public $load_path_functions;
- public $property_syntax;
- public $quiet;
- public $callbacks;
- public $style;
- public $syntax;
- public boolean $debug = FALSE;
- // methods
- public SassParser __construct()
- public mixed __get()
- public void getBasepath()
- public void getDebug_info()
- public void getFilename()
- public void getLine()
- public void getSource()
- public void getLine_numbers()
- public void getFunctions()
- public void getLoad_paths()
- public void getLoad_path_functions()
- public void getProperty_syntax()
- public void getQuiet()
- public void getStyle()
- public void getSyntax()
- public void getDebug()
- public void getCallbacks()
- public void getOptions()
- public string toCss()
- public SassRootNode parse()
- public SassRootNode toTree()
- public void buildTree()
- public SassNode getNode()
- public getToken()
- public sass2Token()
- public integer getLevel()
- public scss2Token()
- public SassToken createToken()
- public SassNode parseDirective()
- public void setIndentChar()
Constants
Name | Value |
---|---|
BEGIN_COMMENT | '/' |
BEGIN_CSS_COMMENT | '/*' |
END_CSS_COMMENT | '*/' |
BEGIN_SASS_COMMENT | '//' |
BEGIN_INTERPOLATION | '#' |
BEGIN_INTERPOLATION_BLOCK | '#{' |
BEGIN_BLOCK | '{' |
END_BLOCK | '}' |
END_STATEMENT | ';' |
DOUBLE_QUOTE | '"' |
SINGLE_QUOTE | "'" |
Members
public
- $basepath
- $callbacks
—
array
callbacks: -
$debug
debug: If enabled it causes exceptions to be thrown on errors. This can be useful for tracking down a bug in your sourcefile but will cause a site to break if used in production unless the parser in wrapped in a try/catch structure. - $debug_info
—
boolean
debug_info: - $filename
—
string
filename: - $functions
—
An
function: - $indentChar — string
- $indentChars — array
- $indentSpaces — integer
-
$instance
Static holder for last instance of a SassParser - $line
—
integer
line: - $line_numbers
—
boolean
line_numbers: - $load_path_functions
- $load_paths
—
array
load_paths: - $property_syntax
—
string
property_syntax: - $quiet
—
boolean
quiet: - $source — string
- $style
—
string
style: - $syntax
—
string
syntax:
Methods
public
- __construct() — Constructor.
- __get() — Getter.
- buildTree() — Builds a parse tree under the parent node.
- createToken() — Returns an object that contains the source statement and meta data about it.
- getBasepath()
- getCallbacks()
- getDebug()
- getDebug_info()
- getFilename()
- getFunctions()
- getLevel() — Returns the level of the line.
- getLine()
- getLine_numbers()
- getLoad_path_functions()
- getLoad_paths()
- getNode() — Creates and returns the next SassNode.
- getOptions()
- getProperty_syntax()
- getQuiet()
- getSource()
- getStyle()
- getSyntax()
- getToken() — Returns a token object that contains the next source statement and meta data about it.
- parse() — Parse a sass file or Sass source code and returns the document tree that can then be rendered.
- parseDirective() — Parses a directive
- sass2Token() — Returns an object that contains the next source statement and meta data about it from SASS source.
- scss2Token() — Returns an object that contains the next source statement and meta data about it from SCSS source.
- setIndentChar() — Determine the indent character and indent spaces.
- toCss() — Parse a sass file or Sass source code and returns the CSS.
- toTree() — Parse Sass source into a document tree.