tablesorter/docs/js/chili/php.js

32 lines
36 KiB
JavaScript
Raw Normal View History

2011-06-22 23:19:27 +00:00
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
===============================================================================
*/
/* "These lists are neither exhaustive or complete" (quote from the PHP Manual) */
{
steps: {
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
, com : { exp: /(?:\/\/.*)|(?:[^\\]\#.*)/ }
, string1 : { exp: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/ }
, string2 : { exp: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/ }
, value : { exp: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/ }
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
, const1 : { exp: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/ }
, const2 : { exp: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/ }
, global : { exp: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/ }
, keyword : { exp: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/ }
, variable: { exp: /\$(\w+)/
, replacement: '<span class="keyword">$</span><span class="variable">$1</span>' }
, heredoc : { exp: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
, replacement: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>' }
, func : { exp: "\\b(?:a(?:bs|cos(?:h|)|dd(?:cslashes|slashes)|ggregat(?:e(?:_(?:info|methods(?:_by_(?:list|regexp)|)|properties(?:_by_(?:list|regexp)|))|)|ion_info)|p(?:ache_(?:child_terminate|get(?:_(?:modules|version)|env)|lookup_uri|note|re(?:quest_headers|s(?:et_timeout|ponse_headers))|setenv)|d_(?:breakpoint|c(?:allstack|lunk|ontinue|roak)|dump_(?:function_table|persistent_resources|regular_resources)|echo|get_active_symbols|set_(?:pprof_trace|s(?:ession(?:_trace|)|ocket_session_trace))))|r(?:ray_(?:c(?:h(?:ange_key_case|unk)|o(?:mbine|unt_values))|diff(?:_(?:assoc|key|u(?:assoc|key))|)|f(?:il(?:l|ter)|lip)|intersect(?:_(?:assoc|key|u(?:assoc|key))|)|key(?:_exists|s)|m(?:ap|erge(?:_recursive|)|ultisort)|p(?:ad|op|ush)|r(?:and|e(?:duce|verse))|s(?:earch|hift|lice|plice|um)|u(?:diff(?:_(?:assoc|uassoc)|)|intersect(?:_(?:assoc|uassoc)|)|n(?:ique|shift))|values|walk(?:_recursive|))|sort)|s(?:cii2ebcdic|in(?:h|)|ort|pell_(?:check(?:_raw|)|new|suggest)|sert(?:_options|))|tan(?:2|h|))|b(?:ase(?:64_(?:decode|encode)|_convert|name)|c(?:add|comp|div|m(?:od|ul)|ompile(?:_write_file|r_(?:load(?:_exe|)|parse_class|read|write_(?:c(?:lass|onstant)|exe_footer|f(?:ooter|unction(?:s_from_file|))|header)))|pow(?:mod|)|s(?:cale|qrt|ub))|in(?:2hex|d(?:_textdomain_codeset|ec|textdomain))|z(?:c(?:lose|ompress)|decompress|err(?:no|or|str)|flush|open|read|write))|c(?:al(?:_(?:days_in_month|from_jd|info|to_jd)|l_user_(?:func(?:_array|)|method(?:_array|)))|cvs_(?:a(?:dd|uth)|co(?:mmand|unt)|d(?:elete|one)|init|lookup|new|re(?:port|turn|verse)|s(?:ale|tatus)|textvalue|void)|eil|h(?:dir|eckd(?:ate|nsrr)|grp|mod|o(?:p|wn)|r(?:oot|)|unk_split)|l(?:ass(?:_(?:exists|implements|parents)|kit_(?:import|method_(?:add|copy|re(?:define|move|name))))|earstatcache|ose(?:dir|log))|o(?:m(?:_(?:addref|create_guid|event_sink|get(?:_active_object|)|i(?:nvoke|senum)|load(?:_typelib|)|message_pump|pr(?:int_typeinfo|op(?:get|put|set))|release|set)|pact|)|n(?:nection_(?:aborted|status|timeout)|stant|vert_(?:cyr_string|uu(?:decode|encode)))|py|s(?:h|)|unt(?:_chars|))|pdf_(?:a(?:dd_(?:annotation|outline)|rc)|begin_text|c(?:ircle|l(?:ip|ose(?:path(?:_(?:fill_stroke|stroke)|)|))|ontinue_text|urveto)|end_text|fi(?:ll(?:_stroke|)|nalize(?:_page|))|global_set_document_limits|import_jpeg|lineto|moveto|newpath|o(?:pen|utput_buffer)|p(?:age_init|lace_inline_image)|r(?:e(?:ct|store)|lineto|moveto|otate(?:_text|))|s(?:ave(?:_to_file|)|cale|et(?:_(?:action_url|c(?:har_spacing|reator|urrent_page)|font(?:_(?:directories|map_file)|)|horiz_scaling|keywords|leading|page_animation|subject|t(?:ext_(?:matrix|pos|r(?:endering|ise))|itle)|viewer_preferences|word_spacing)|dash|flat|gray(?:_(?:fill|stroke)|)|line(?:cap|join|width)|miterlimit|rgbcolor(?:_(?:fill|stroke)|))|how(?:_xy|)|tr(?:ingwidth|oke))|t(?:ext|ranslate))|r(?:ack_(?:c(?:heck|losedict)|getlastmessage|opendict)|c32|eate_function|ypt)|type_(?:al(?:num|pha)|cntrl|digit|graph|lower|p(?:rint|unct)|space|upper|xdigit)|ur(?:l_(?:c(?:lose|opy_handle)|e(?:rr(?:no|or)|xec)|getinfo|init|multi_(?:add_handle|close|exec|getcontent|in(?:fo_read|it)|remove_handle|select)|setopt|version)|rent)|y(?:bercash_(?:base64_(?:decode|encode)|decr|encr)|rus_(?:authenticate|bind|c(?:lose|onnect)|query|unbind)))|d(?:ate(?:_sun(?:rise|set)|)|b(?:a(?:_(?:close|delete|exists|f(?:etch|irstkey)|handlers|insert|key_split|list|nextkey|op(?:en|timize)|popen|replace|sync)|se_(?:add_record|c(?:lose|reate)|delete_record|get_(?:header_info|record(?:_with_names|))|num(?:fields|records)|open|pack|replace_record))|list|m(?:close|delete|exists|f(?:etch|irstkey)|insert|nextkey|open|replace)|plus_(?:a(?:dd|ql)|c(?:hdir|lose|urr)|err(?:code|no)|f(?:i(?:nd|rst)|lush|ree(?:alllocks|lock|rlocks))|get(?:lock|unique)|info|l(?:ast|ockrel)|next|open|prev|r(?:c(?:hperm|r(?:eate|t(?:exact|like)))|es(?:olve|torepos)|keys|open|query|rename|secindex|unlink|zap)|s(?:avepos|etindex(?:bynumber|)|ql)|t(?:cl|remove)|u(?:n(?:do(?:prepare|)|lockrel|select)|pdate)|x(?:lockrel|unlockrel))|x_(?:c(?:lose|o(?:mpare|nnect))|e(?:rror|scape_string)|fetch_row|query|sort))|c(?:gettext|ngettex
}
}