PHP 클래스 SassParser

Parses {@link http://sass-lang.com/ Sass} files.
파일 보기 프로젝트 열기: richthegeek/phpsass 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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