Lines Matching defs:key

131 /** The key of the regex array defining what to search for */
133 /** The key of the regex array defining what bracket group in a
136 /** The key of the regex array defining any modifiers to the regular expression */
138 /** The key of the regex array defining what bracket group in a
141 /** The key of the regex array defining what bracket group in a
144 /** The key of the regex array defining a custom keyword to use
989 * @param int $key The key of the keyword group to change the styles of
995 public function set_keyword_group_style($key, $style, $preserve_defaults = false) {
997 if('*' == $key) {
1007 $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
1009 $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
1014 if (!isset($this->lexic_permissions['KEYWORDS'][$key])) {
1015 $this->lexic_permissions['KEYWORDS'][$key] = true;
1022 * @param int $key The key of the keyword group to turn on or off
1026 public function set_keyword_group_highlighting($key, $flag = true) {
1027 $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
1035 * @param int $key The key of the comment group to change the styles of
1041 public function set_comments_style($key, $style, $preserve_defaults = false) {
1042 if('*' == $key) {
1052 $this->language_data['STYLES']['COMMENTS'][$key] = $style;
1054 $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
1062 * @param int $key The key of the comment group to turn on or off
1066 public function set_comments_highlighting($key, $flag = true) {
1067 $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
1253 * Sets the styles for methods. $key is a number that references the
1259 * @param int $key The key of the object splitter to change the styles of
1265 public function set_methods_style($key, $style, $preserve_defaults = false) {
1267 $this->language_data['STYLES']['METHODS'][$key] = $style;
1269 $this->language_data['STYLES']['METHODS'][$key] .= $style;
1288 * @param string $key The style to make the regular expression matches
1295 public function set_regexps_style($key, $style, $preserve_defaults = false) {
1297 $this->language_data['STYLES']['REGEXPS'][$key] = $style;
1299 $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
1306 * @param int $key The key of the regular expression group to turn on or off
1310 public function set_regexps_highlighting($key, $flag) {
1311 $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
1317 * @param int $key The key of the keyword group to change the case sensitivity of
1321 public function set_case_sensitivity($key, $case) {
1322 $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
1423 foreach ($this->lexic_permissions as $key => $value) {
1426 $this->lexic_permissions[$key][$k] = $flag;
1429 $this->lexic_permissions[$key] = $flag;
1567 * @param int $key The key of the keyword group to add the keyword to
1571 public function add_keyword($key, $word) {
1572 if (!is_array($this->language_data['KEYWORDS'][$key])) {
1573 $this->language_data['KEYWORDS'][$key] = array();
1575 if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
1576 $this->language_data['KEYWORDS'][$key][] = $word;
1580 $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
1581 $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
1589 * @param int $key The key of the keyword group to remove the keyword from
1599 public function remove_keyword($key, $word, $recompile = true) {
1600 $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
1602 unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
1606 $this->optimize_keyword_group($key);
1614 * @param int $key The key of the keyword group to create
1621 public function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
1629 $this->language_data['KEYWORDS'][$key] = $words;
1630 $this->lexic_permissions['KEYWORDS'][$key] = true;
1631 $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
1632 $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
1636 $this->optimize_keyword_group($key);
1644 * @param int $key The key of the keyword group to remove
1647 public function remove_keyword_group ($key) {
1649 unset($this->language_data['KEYWORDS'][$key]);
1650 unset($this->lexic_permissions['KEYWORDS'][$key]);
1651 unset($this->language_data['CASE_SENSITIVE'][$key]);
1652 unset($this->language_data['STYLES']['KEYWORDS'][$key]);
1655 unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]);
1661 * @param int $key The key of the keyword group to compile & optimize
1664 public function optimize_keyword_group($key) {
1665 $this->language_data['CACHED_KEYWORD_LISTS'][$key] =
1666 $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]);
1673 if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
1674 if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
1675 $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'];
1681 foreach($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) {
1682 $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] =
1742 * @param int $group The key of the keyword group to set the URL for
1989 foreach ($this->language_data['SYMBOLS'] as $key => $symbols) {
1994 $this->language_data['SYMBOL_DATA'][$sym] = $key;
2023 //Now we have an array with each possible symbol as the key and the style as the actual data.
2042 foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
2043 if (!isset($this->lexic_permissions['KEYWORDS'][$key]) ||
2044 $this->lexic_permissions['KEYWORDS'][$key]) {
2045 $this->optimize_keyword_group($key);
2122 foreach($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) {
2137 $this->language_data['NUMBERS_RXCACHE'][$key] =
2434 for ($key = 0; $key < $num_parts; ++$key) {
2438 if (!($key & 1)) {
2440 $endresult .= $this->hsc($parts[$key][1]);
2441 unset($parts[$key]);
2446 $part = $parts[$key][1];
2449 if ($this->strict_mode && !is_null($parts[$key][0])) {
2450 // get the class key for this block of code
2451 $script_key = $parts[$key][0];
2511 'key' => $comment_key,
2612 'key' => $escape_key,
2705 //Get the key and length of this match ...
2708 $escape_key = $escape['key'];
2861 $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"';
2863 $attributes = ' class="co' . $comment['key'] . '"';
3093 unset($part, $parts[$key], $result);
3129 for ($key = 0, $n = count($lines); $key < $n; $key++) {
3130 $line = $lines[$key];
3137 $lines[$key] = ''; // reduce memory
3153 $lines[$key] .= $char;
3156 $lines[$key] .= '<';
3165 $lines[$key] .= $char;
3180 $lines[$key] .= $str;
3184 $lines[$key] .= substr($line, $i + 1);
3188 $lines[$key] .= '&nbsp;';
3191 $lines[$key] .= $char;
3419 foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
3420 if ($this->lexic_permissions['REGEXPS'][$key]) {
3426 $this->_hmr_key = $key;
3438 $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER],
3444 $this->_hmr_key = $key;
3449 $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
3520 foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
3523 $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
3525 $attributes = ' class="me' . $key . '"';
3527 $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse);
3615 foreach (array_keys($this->language_data['REGEXPS']) as $key) {
3616 if ($this->lexic_permissions['REGEXPS'][$key]) {
3617 if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) {
3618 $this->_rx_key = $key;
3619 $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U",
3624 $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
3626 if (is_array($this->language_data['REGEXPS'][$key]) &&
3627 array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) {
3629 $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
3631 $attributes = ' class="re' . $key . '"';
3634 $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
3708 foreach ($arrays[$i] as $key => $value) {
3709 if (is_array($value) && isset($ret[$key])) {
3710 // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays)
3711 // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false.
3712 $ret[$key] = $this->merge_arrays($ret[$key], $value);
3714 $ret[$key] = $value;
3753 foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
3754 if (!empty($this->language_data['KEYWORDS'][$key])) {
3755 $this->lexic_permissions['KEYWORDS'][$key] = true;
3757 $this->lexic_permissions['KEYWORDS'][$key] = false;
3761 foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) {
3762 $this->lexic_permissions['COMMENTS'][$key] = true;
3764 foreach (array_keys($this->language_data['REGEXPS']) as $key) {
3765 $this->lexic_permissions['REGEXPS'][$key] = true;
3785 foreach ($this->lexic_permissions[$flag] as $key => $val) {
3786 $this->lexic_permissions[$flag][$key] = $perm;
3934 foreach ($attrs as $key => $attr) {
3935 $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"';
4404 // or the appropriate key is given.
4405 foreach ($this->link_styles as $key => $style) {
4407 switch ($key) {
4608 // this entry has at least some chars in common with the current key
4610 // current key is totally matched, i.e. this entry has just some bits appended
4629 // recreate key index