You are here

private function HamlParser::parseWhitespaceControl in Sassy 7

1 call to HamlParser::parseWhitespaceControl()
HamlParser::parseElement in phamlp/haml/HamlParser.php
* Parse an element. *

File

phamlp/haml/HamlParser.php, line 1236

Class

HamlParser
HamlParser class. Parses {@link http://haml-lang.com/ Haml} view files. @package PHamlP @subpackage Haml

Code

private function parseWhitespaceControl($line) {
  $whitespaceControl = array(
    'inner' => false,
    'outer' => array(
      'left' => false,
      'right' => false,
    ),
  );
  if (!empty($line[self::HAML_WHITESPACE_REMOVAL])) {
    $whitespaceControl['inner'] = strpos($line[self::HAML_WHITESPACE_REMOVAL], self::INNER_WHITESPACE_REMOVAL) !== false;
    if (strpos($line[self::HAML_WHITESPACE_REMOVAL], self::OUTER_WHITESPACE_REMOVAL) !== false) {
      $whitespaceControl['outer']['left'] = strpos($line[self::HAML_WHITESPACE_REMOVAL], self::BLOCK_LEFT_OUTER_WHITESPACE_REMOVAL) === false;
      $whitespaceControl['outer']['right'] = strpos($line[self::HAML_WHITESPACE_REMOVAL], self::BLOCK_RIGHT_OUTER_WHITESPACE_REMOVAL) === false;
    }
  }
  return $whitespaceControl;
}