PHP Класс SassParser

Parses {@link http://sass-lang.com/ Sass} files.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$basepath Option
$callbacks callbacks:
$debug Defaults to FALSE
$debug_info debug_info:
$filename filename:
$functions function:
$indentChar the character used for indenting
$indentChars allowable characters for indenting
$indentSpaces number of spaces for indentation. Used to calculate {@link Level} if {@link indentChar} is space.
$instance Static holder for last instance of a SassParser
$line line:
$line_numbers line_numbers:
$load_path_functions
$load_paths load_paths:
$property_syntax property_syntax:
$quiet quiet:
$source source
$style style:
$syntax syntax:

Открытые методы

Метод Описание
__construct ( array $options = [] ) : SassParser Constructor.
__get ( string $name ) : mixed Getter.
buildTree ( SassNode $parent ) : SassNode Builds a parse tree under the parent node.
createToken ( string $statement ) : object | null Returns an object that contains the source statement and meta data about it.
getBasepath ( )
getCallbacks ( )
getDebug ( )
getDebug_info ( )
getFilename ( )
getFunctions ( )
getLevel ( string $source ) : integer Returns the level of the line.
getLine ( )
getLine_numbers ( )
getLoad_path_functions ( )
getLoad_paths ( )
getNode ( SassNode $node ) : SassNode | null Creates and returns the next SassNode.
getOptions ( )
getProperty_syntax ( )
getQuiet ( )
getSource ( )
getStyle ( )
getSyntax ( )
getToken ( ) : object Returns a token object that contains the next source statement and meta data about it.
parse ( string $source, boolean $isFile = true ) : SassRootNode Parse a sass file or Sass source code and returns the document tree that can then be rendered.
parseDirective ( stdClass $token, SassNode $parent ) : SassNode Parses a directive
sass2Token ( ) : object Returns an object that contains the next source statement and meta data about it from SASS source.
scss2Token ( ) : object 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 ( string $source, boolean $isFile = true ) : string Parse a sass file or Sass source code and returns the CSS.
toTree ( string $source ) : SassRootNode Parse Sass source into a document tree.

Описание методов

__construct() публичный Метод

Sets parser options
public __construct ( array $options = [] ) : SassParser
$options array
Результат SassParser

__get() публичный Метод

Getter.
public __get ( string $name ) : mixed
$name string name of property to get
Результат mixed return value of getter function

buildTree() публичный Метод

Called recursivly until the source is parsed.
public buildTree ( SassNode $parent ) : SassNode
$parent SassNode the node
Результат SassNode

createToken() публичный Метод

If the statement is just and end block we update the meta data and return null.
public createToken ( string $statement ) : object | null
$statement string source statement
Результат object | null

getBasepath() публичный Метод

public getBasepath ( )

getCallbacks() публичный Метод

public getCallbacks ( )

getDebug() публичный Метод

public getDebug ( )

getDebug_info() публичный Метод

public getDebug_info ( )

getFilename() публичный Метод

public getFilename ( )

getFunctions() публичный Метод

public getFunctions ( )

getLevel() публичный Метод

Used for .sass source
public getLevel ( string $source ) : integer
$source string the source
Результат integer the level of the source

getLine() публичный Метод

public getLine ( )

getLine_numbers() публичный Метод

public getLine_numbers ( )

getLoad_path_functions() публичный Метод

getLoad_paths() публичный Метод

public getLoad_paths ( )

getNode() публичный Метод

The tpye of SassNode depends on the content of the SassToken.
public getNode ( SassNode $node ) : SassNode | null
$node SassNode
Результат SassNode | null a SassNode of the appropriate type. Null when no more source to parse.

getOptions() публичный Метод

public getOptions ( )

getProperty_syntax() публичный Метод

public getProperty_syntax ( )

getQuiet() публичный Метод

public getQuiet ( )

getSource() публичный Метод

public getSource ( )

getStyle() публичный Метод

public getStyle ( )

getSyntax() публичный Метод

public getSyntax ( )

getToken() публичный Метод

Returns a token object that contains the next source statement and meta data about it.
public getToken ( ) : object
Результат object

parse() публичный Метод

The file will be searched for in the directories specified by the load_paths option.
public parse ( string $source, boolean $isFile = true ) : SassRootNode
$source string name of source file or Sass source
$isFile boolean
Результат SassRootNode Root node of document tree

parseDirective() публичный Метод

Parses a directive
public parseDirective ( stdClass $token, SassNode $parent ) : SassNode
$token stdClass token to parse
$parent SassNode parent node
Результат SassNode a Sass directive node

sass2Token() публичный Метод

Sass statements are passed over. Statements spanning multiple lines, e.g. CSS comments and selectors, are assembled into a single statement.
public sass2Token ( ) : object
Результат object Statement token. Null if end of source.

scss2Token() публичный Метод

Returns an object that contains the next source statement and meta data about it from SCSS source.
public scss2Token ( ) : object
Результат object Statement token. Null if end of source.

setIndentChar() публичный Метод

The first character of the first indented line determines the character. If this is a space the number of spaces determines the indentSpaces; this is always 1 if the indent character is a tab. Only used for .sass files.
public setIndentChar ( )

toCss() публичный Метод

Parse a sass file or Sass source code and returns the CSS.
public toCss ( string $source, boolean $isFile = true ) : string
$source string name of source file or Sass source
$isFile boolean
Результат string CSS

toTree() публичный Метод

If the tree is already created return that.
public toTree ( string $source ) : SassRootNode
$source string Sass source
Результат SassRootNode the root of this document tree

Описание свойств

$basepath публичное свойство

Option
public $basepath

$callbacks публичное свойство

callbacks:
public $callbacks

$debug публичное свойство

Defaults to FALSE
public $debug

$debug_info публичное свойство

debug_info:
См. также: style
public $debug_info

$filename публичное свойство

filename:
public $filename

$functions публичное статическое свойство

function:
public static $functions

$indentChar публичное свойство

the character used for indenting
См. также: indentChars
См. также: indentSpaces
public $indentChar

$indentChars публичное свойство

allowable characters for indenting
public $indentChars

$indentSpaces публичное свойство

number of spaces for indentation. Used to calculate {@link Level} if {@link indentChar} is space.
public $indentSpaces

$instance публичное статическое свойство

Static holder for last instance of a SassParser
public static $instance

$line публичное свойство

line:
public $line

$line_numbers публичное свойство

line_numbers:
См. также: debug_info
См. также: style
public $line_numbers

$load_path_functions публичное свойство

public $load_path_functions

$load_paths публичное свойство

load_paths:
public $load_paths

$property_syntax публичное свойство

property_syntax:
public $property_syntax

$quiet публичное свойство

quiet:
public $quiet

$source публичное свойство

source
public $source

$style публичное свойство

style:
public $style

$syntax публичное свойство

syntax:
public $syntax