Same name in other branches
- 5.0.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeKeywords()
- 7.x-1.x advagg_js_compress/jspacker.inc \JavaScriptPacker::_encodeKeywords()
- 7.x-2.x advagg_js_compress/jspacker.inc \JavaScriptPacker::_encodeKeywords()
- 8.x-2.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeKeywords()
- 8.x-3.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeKeywords()
- 8.x-4.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeKeywords()
File
-
advagg_js_minify/
jspacker.inc, line 193
Class
Code
private function _encodeKeywords($script) {
// escape high-ascii values already in the script (i.e. in strings)
if ($this->_encoding > 62) {
$script = $this->_escape95($script);
}
// create the parser
$parser = new ParseMaster();
$encode = $this->_getEncoder($this->_encoding);
// for high-ascii, don't encode single character low-ascii
$regexp = $this->_encoding > 62 ? '/\\w\\w+/' : '/\\w+/';
// build the word list
$keywords = $this->_analyze($script, $regexp, $encode);
$encoded = $keywords['encoded'];
// encode
$parser->add($regexp, array(
'fn' => '_replace_encoded',
'data' => $encoded,
));
if (empty($script)) {
return $script;
}
else {
//$res = $parser->exec($script);
//$res = $this->_bootStrap($res, $keywords);
//return $res;
return $this->_bootStrap($parser->exec($script), $keywords);
}
}