public function __construct($sText, Settings $oParserSettings = null)
{
$this->iCurrentPosition = 0;
if ($oParserSettings === null) {
$oParserSettings = Settings::create();
}
$this->oParserSettings = $oParserSettings;
if ($this->oParserSettings->bMultibyteSupport) {
$this->aText = preg_split('//u', $sText, null, PREG_SPLIT_NO_EMPTY);
} else {
if ($sText === '') {
$this->aText = array();
} else {
$this->aText = str_split($sText);
}
}
$this->blockRules = explode('/', AtRule::BLOCK_RULES);
foreach (explode('/', Size::ABSOLUTE_SIZE_UNITS . '/' . Size::RELATIVE_SIZE_UNITS . '/' . Size::NON_SIZE_UNITS) as $val) {
$iSize = strlen($val);
if (!isset($this->aSizeUnits[$iSize])) {
$this->aSizeUnits[$iSize] = array();
}
$this->aSizeUnits[$iSize][strtolower($val)] = $val;
}
ksort($this->aSizeUnits, SORT_NUMERIC);
}