// This file has been generated by jsmods. Don't modify it directly. /* * hilite.js * * Copyright (C) 2016, 2017 Sebastian Heimpel and Henri Lesourd * * This file is part of hilite.js. * * hilite.js is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * hilite.js is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with hilite.js. If not, see . */ var hilite_ready=false; function hilite_init() { if (!hilite_ready) { for (i=0;i<=255;i++) charnat[i]=UNKNOWN; for (i=asc("A");i<=asc("Z");i++) charnat[i]=ALPHANUM; for (i=asc("a");i<=asc("z");i++) charnat[i]=ALPHANUM; for (i=asc("0");i<=asc("9");i++) charnat[i]=ALPHANUM; charnat[228]=ALPHANUM; charnat[246]=ALPHANUM; charnat[252]=ALPHANUM; charnat[asc("$")]=ALPHANUM; charnat[asc("?")]=ALPHANUM; charnat[asc("_")]=ALPHANUM; charnat[asc("@")]=ALPHANUM; charnat[asc("!")]=ALPHANUM; charnat[asc("-")]=ALPHANUM; charnat[asc("#")]=SERVER?OPCHAR:ALPHANUM; charnat[asc("&")]=SPLITTER; charnat[asc("!")]=SPLITTER; charnat[asc("+")]=SPLITTER; charnat[asc("*")]=SPLITTER; charnat[asc("%")]=SPLITTER; charnat[asc(",")]=SPLITTER; charnat[asc(":")]=SPLITTER; charnat[asc(";")]=SPLITTER; charnat[asc(".")]=SPLITTER; charnat[asc("=")]=SPLITTER; charnat[asc("|")]=SPLITTER; charnat[asc(".")]=SPLITTER; charnat[asc("(")]=charnat[asc(")")]=SPLITTER; charnat[asc("[")]=charnat[asc("]")]=SPLITTER; charnat[asc("{")]=charnat[asc("}")]=SPLITTER; charnat[asc("<")]=charnat[asc(">")]=charnat[asc("/")]=SPLITTER; charnat[asc("^")]=SPLITTER; charnat[asc("\\")]=ALPHANUM; charnat[asc("\t")]=BLANK; charnat[asc("\n")]=BLANK; charnat[asc("\r")]=BLANK; charnat[asc(" ")]=BLANK; charnat[asc("'")]=QUOTE; charnat[asc("\"")]=DQUOTE; } hilite_ready=true; } var cssop={ "{":1, "}":1, ";":1, "(":1, ")":1, ":":1, ",":1 }; var csskeyw={ "":1 }; var csspred={ "alignment-adjust":1, "alignment-baseline":1, "animation":1, "animation-delay":1, "animation-direction ":1, "animation-duration":1, "animation-iteration-count":1, "animation-name":1, "animation-play-state":1, "animation-timing-function":1, "appearance ":1, "azimuth":1, "background":1, "background-attachment":1, "background-break":1, "background-clip":1, "background-color":1, "background-image":1, "background-origin":1, "background-position":1, "background-repeat":1, "background-size":1, "baseline-shift":1, "binding":1, "bookmark-label":1, "bookmark-level":1, "bookmark-target":1, "border":1, "border-bottom":1, "border-bottom-color":1, "border-bottom-left-radius":1, "border-bottom-right-radius":1, "border-bottom-style":1, "border-bottom-width":1, "border-break":1, "border-collapse":1, "border-color":1, "border-image":1, "border-left":1, "border-left-color":1, "border-left-style":1, "border-left-width":1, "border-length":1, "border-radius":1, "border-right":1, "border-right-color":1, "border-right-style":1, "border-right-width":1, "border-spacing":1, "border-style":1, "border-top":1, "border-top-color":1, "border-top-left-radius":1, "border-top-right-radius":1, "border-top-style":1, "border-top-width":1, "border-width":1, "bottom":1, "box-align":1, "box-direction ":1, "box-flex":1, "box-flex-group":1, "box-lines":1, "box-ordinal-group":1, "box-orient":1, "box-pack":1, "box-shadow":1, "box-sizing":1, "caption-side":1, "clear":1, "clip":1, "color":1, "color-profile":1, "column-break-after":1, "column-break-before":1, "column-count":1, "column-fill":1, "column-gap ":1, "column-rule":1, "column-rule-color":1, "column-rule-style":1, "column-rule-width":1, "column-span":1, "column-width":1, "columns":1, "content ":1, "counter-increment":1, "counter-reset":1, "crop":1, "cue":1, "cue-after":1, "cue-before":1, "cursor":1, "direction":1, "display":1, "display-model":1, "display-role":1, "dominant-baseline":1, "drop-initial-after-adjust":1, "drop-initial-after-align":1, "drop-initial-before-adjust":1, "drop-initial-before-align":1, "drop-initial-size":1, "drop-initial-value":1, "elevation":1, "empty-cells":1, "fit":1, "fit-position":1, "float":1, "float-offset":1, "font":1, "font-family":1, "font-size":1, "font-size-adjust":1, "font-stretch ":1, "font-style ":1, "font-variant ":1, "font-weight ":1, "grid-columns":1, "grid-rows":1, "hanging-punctuation":1, "height":1, "hyphenate-after":1, "hyphenate-before":1, "hyphenate-character":1, "hyphenate-lines":1, "hyphenate-resource":1, "hyphens":1, "icon":1, "image-orientation":1, "image-resolution":1, "inline-box-align":1, "left":1, "letter-spacing ":1, "line-height ":1, "line-stacking":1, "line-stacking-ruby":1, "line-stacking-shift":1, "line-stacking-strategy":1, "list-style":1, "list-style-image":1, "list-style-position":1, "list-style-type":1, "margin":1, "margin-bottom":1, "margin-left":1, "margin-right":1, "margin-top":1, "mark":1, "mark-after":1, "mark-before":1, "marks":1, "marquee-direction":1, "marquee-play-count":1, "marquee-speed ":1, "marquee-style":1, "max-height":1, "max-width":1, "min-height":1, "min-width":1, "move-to ":1, "nav-down":1, "nav-index":1, "nav-left":1, "nav-right":1, "nav-up":1, "opacity":1, "orphans":1, "outline":1, "outline-color":1, "outline-offset":1, "outline-style":1, "outline-width":1, "overflow":1, "overflow-style":1, "overflow-x":1, "overflow-y":1, "padding":1, "padding-bottom":1, "padding-left":1, "padding-right":1, "padding-top":1, "page":1, "page-break-after":1, "page-break-before":1, "page-break-inside":1, "page-policy":1, "pause":1, "pause-after":1, "pause-before":1, "phonemes":1, "pitch":1, "pitch-range":1, "play-during":1, "position":1, "presentation-level":1, "punctuation-trim":1, "quotes":1, "rendering-intent":1, "resize":1, "rest":1, "rest-after":1, "rest-before":1, "richness":1, "right":1, "rotation":1, "rotation-point":1, "ruby-align":1, "ruby-overhang":1, "ruby-position":1, "ruby-span":1, "size":1, "speak ":1, "speak-header":1, "speak-numeral":1, "speak-punctuation":1, "speech-rate":1, "stress":1, "string-set":1, "tab-side":1, "table-layout":1, "target":1, "target-name":1, "target-new":1, "target-position":1, "text-align":1, "text-align-last":1, "text-decoration":1, "text-emphasis":1, "text-height":1, "text-indent":1, "text-justify":1, "text-outline":1, "text-replace":1, "text-shadow":1, "text-transform":1, "text-wrap ":1, "top":1, "transition":1, "transition-delay":1, "transition-duration":1, "transition-property":1, "transition-timing-function":1, "unicode-bidi":1, "vertical-align":1, "visibility":1, "voice-balance":1, "voice-duration":1, "voice-family":1, "voice-pitch":1, "voice-pitch-range":1, "voice-rate":1, "voice-stress":1, "voice-volume":1, "volume":1, "white-space ":1, "white-space-collapse":1, "widows":1, "width":1, "word-break":1, "word-spacing":1, "word-wrap":1, "z-index":1 }; var selftag={ "link":1, "br":1, "hr":1, "img":1, "input":1, "meta":1, "var":1, "button":1 }; var optclose={ "li":1 }; var cdata={ "!DOCTYPE":1, "!--":1, "script":1, "?php":1, "!--?php":1 }; var jsop={ "(":1, ")":1, "=":1, "<":1, ">":1, "{":1, "}":1, "[":1, "]":1, ",":1, "+":1, "-":1, ";":1, ":":1, "*":1, "/":1, "!":1, "&":1, "|":1, ".":1 }; var jskeyw={ "var":1, "function":1, "for":1, "while":1, "return":1 }; var jspred={ "integer":1 }; var phpop={ "(":1, ")":1, "=":1, "<":1, ">":1, "{":1, "}":1, "[":1, "]":1, ",":1, ";":1 }; var phpkeyw={ "__halt_compiler":1, "abstract":1, "and":1, "as":1, "break":1, "callable":1, "case":1, "catch":1, "class":1, "clone":1, "const":1, "continue":1, "declare":1, "default":1, "die":1, "do":1, "echo":1, "else":1, "elseif":1, "empty":1, "enddeclare":1, "endfor":1, "endforeach":1, "endif":1, "endswitch":1, "endwhile":1, "eval":1, "exit":1, "extends":1, "final":1, "for":1, "foreach":1, "function":1, "global":1, "goto":1, "if":1, "implements":1, "include":1, "include_once":1, "instanceof":1, "insteadof":1, "interface":1, "isset":1, "list":1, "namespace":1, "new":1, "or":1, "print":1, "private":1, "protected":1, "public":1, "require":1, "require_once":1, "return":1, "static":1, "switch":1, "throw":1, "trait":1, "try":1, "unset":1, "use":1, "var":1, "while":1, "xor":1 }; var phppred={ "integer":1, "string":1, "array":1, "mixed":1 }; var sqlop={ "(":1, ")":1, ",":1, ";":1, "=":1, "*":1 }; var sqlkeyw={ "a":1, "abort":1, "abs":1, "absolute":1, "access":1, "action":1, "ada":1, "add":1, "admin":1, "after":1, "aggregate":1, "alias":1, "all":1, "allocate":1, "also":1, "alter":1, "always":1, "analyse":1, "analyze":1, "and":1, "are":1, "as":1, "asc":1, "asensitive":1, "assertion":1, "assignment":1, "asymmetric":1, "at":1, "atomic":1, "attribute":1, "attributes":1, "audit":1, "authorization":1, "auto_increment":1, "avg":1, "avg_row_length":1, "backup":1, "backward":1, "before":1, "begin":1, "bernoulli":1, "between":1, "bit_length":1, "both":1, "breadth":1, "break":1, "browse":1, "bulk":1, "by":1, "c":1, "cache":1, "call":1, "called":1, "cardinality":1, "cascade":1, "cascaded":1, "case":1, "cast":1, "catalog":1, "catalog_name":1, "ceil":1, "ceiling":1, "chain":1, "change":1, "char_length":1, "character_length":1, "character_set_catalog":1, "character_set_name":1, "character_set_schema":1, "characteristics":1, "characters":1, "check":1, "checked":1, "checkpoint":1, "checksum":1, "class":1, "class_origin":1, "clob":1, "close":1, "cluster":1, "clustered":1, "coalesce":1, "cobol":1, "collate":1, "collation":1, "collation_catalog":1, "collation_name":1, "collation_schema":1, "collect":1, "column":1, "column_name":1, "columns":1, "command_function":1, "command_function_code":1, "comment":1, "commit":1, "committed":1, "completion":1, "compress":1, "compute":1, "condition":1, "condition_number":1, "connect":1, "connection":1, "connection_name":1, "constraint":1, "constraint_catalog":1, "constraint_name":1, "constraint_schema":1, "constraints":1, "constructor":1, "contains":1, "containstable":1, "continue":1, "conversion":1, "convert":1, "copy":1, "corr":1, "corresponding":1, "count":1, "covar_pop":1, "covar_samp":1, "create":1, "createdb":1, "createrole":1, "createuser":1, "cross":1, "csv":1, "cube":1, "cume_dist":1, "current":1, "current_date":1, "current_default_transform_group":1, "current_path":1, "current_role":1, "current_time":1, "current_timestamp":1, "current_transform_group_for_type":1, "current_user":1, "cursor":1, "cursor_name":1, "cycle":1, "data":1, "database":1, "databases":1, "datetime_interval_code":1, "datetime_interval_precision":1, "day_hour":1, "day_microsecond":1, "day_minute":1, "day_second":1, "dayofmonth":1, "dayofweek":1, "dayofyear":1, "dbcc":1, "deallocate":1, "dec":1, "decimal":1, "declare":1, "default":1, "defaults":1, "deferrable":1, "deferred":1, "defined":1, "definer":1, "degree":1, "delay_key_write":1, "delayed":1, "delete":1, "delimiter":1, "delimiters":1, "dense_rank":1, "deny":1, "depth":1, "deref":1, "derived":1, "desc":1, "describe":1, "descriptor":1, "destroy":1, "destructor":1, "deterministic":1, "diagnostics":1, "dictionary":1, "disable":1, "disconnect":1, "disk":1, "dispatch":1, "distinct":1, "distinctrow":1, "distributed":1, "div":1, "do":1, "domain":1, "drop":1, "dual":1, "dummy":1, "dump":1, "dynamic":1, "dynamic_function":1, "dynamic_function_code":1, "each":1, "element":1, "else":1, "elseif":1, "enable":1, "enclosed":1, "encoding":1, "encrypted":1, "end":1, "end-exec":1, "enum":1, "equals":1, "errlvl":1, "escape":1, "escaped":1, "every":1, "except":1, "exception":1, "exclude":1, "excluding":1, "exclusive":1, "exec":1, "execute":1, "existing":1, "exists":1, "exit":1, "exp":1, "explain":1, "external":1, "extract":1, "false":1, "fetch":1, "fields":1, "fillfactor":1, "filter":1, "final":1, "first":1, "float":1, "float4":1, "float8":1, "floor":1, "flush":1, "following":1, "for":1, "force":1, "foreign":1, "fortran":1, "forward":1, "found":1, "free":1, "freetext":1, "freetexttable":1, "freeze":1, "from":1, "full":1, "fulltext":1, "function":1, "fusion":1, "g":1, "general":1, "generated":1, "get":1, "global":1, "go":1, "goto":1, "grant":1, "granted":1, "grants":1, "greatest":1, "group":1, "grouping":1, "handler":1, "having":1, "header":1, "heap":1, "hierarchy":1, "high_priority":1, "hold":1, "holdlock":1, "host":1, "hosts":1, "hour_microsecond":1, "hour_minute":1, "hour_second":1, "identified":1, "identity":1, "identity_insert":1, "identitycol":1, "if":1, "ignore":1, "ilike":1, "immediate":1, "immutable":1, "implementation":1, "implicit":1, "in":1, "include":1, "including":1, "increment":1, "index":1, "indicator":1, "infile":1, "infix":1, "inherit":1, "inherits":1, "initial":1, "initialize":1, "initially":1, "inner":1, "inout":1, "input":1, "insensitive":1, "insert":1, "insert_id":1, "instance":1, "instantiable":1, "instead":1, "intersect":1, "intersection":1, "interval":1, "into":1, "invoker":1, "is":1, "isam":1, "isnull":1, "isolation":1, "iterate":1, "join":1, "k":1, "key":1, "key_member":1, "key_type":1, "keys":1, "kill":1, "lancompiler":1, "language":1, "large":1, "last":1, "last_insert_id":1, "lateral":1, "leading":1, "least":1, "leave":1, "left":1, "length":1, "less":1, "level":1, "like":1, "limit":1, "lineno":1, "lines":1, "listen":1, "ln":1, "load":1, "local":1, "localtime":1, "localtimestamp":1, "location":1, "locator":1, "lock":1, "login":1, "logs":1, "loop":1, "low_priority":1, "lower":1, "m":1, "map":1, "match":1, "matched":1, "max":1, "max_rows":1, "maxextents":1, "maxvalue":1, "mediumblob":1, "mediumint":1, "mediumtext":1, "member":1, "merge":1, "message_length":1, "message_octet_length":1, "message_text":1, "method":1, "middleint":1, "min":1, "min_rows":1, "minus":1, "minute_microsecond":1, "minute_second":1, "minvalue":1, "mlslabel":1, "mod":1, "mode":1, "modifies":1, "modify":1, "module":1, "month":1, "monthname":1, "more":1, "move":1, "multiset":1, "mumps":1, "myisam":1, "name":1, "names":1, "national":1, "natural":1, "nchar":1, "nclob":1, "nesting":1, "new":1, "next":1, "no":1, "no_write_to_binlog":1, "noaudit":1, "nocheck":1, "nocompress":1, "nocreatedb":1, "nocreaterole":1, "nocreateuser":1, "noinherit":1, "nologin":1, "nonclustered":1, "none":1, "normalize":1, "normalized":1, "nosuperuser":1, "not":1, "nothing":1, "notify":1, "null":1, "notnull":1, "nowait":1, "nullif":1, "nulls":1, "octet_length":1, "of":1, "off":1, "offline":1, "offset":1, "offsets":1, "oids":1, "old":1, "on":1, "online":1, "only":1, "open":1, "opendatasource":1, "openquery":1, "openrowset":1, "openxml":1, "operation":1, "operator":1, "optimize":1, "option":1, "optionally":1, "options":1, "or":1, "order":1, "ordering":1, "ordinality":1, "others":1, "out":1, "outer":1, "outfile":1, "output":1, "over":1, "overlaps":1, "overlay":1, "overriding":1, "owner":1, "pack_keys":1, "pad":1, "parameter":1, "parameter_mode":1, "parameter_name":1, "parameter_ordinal_position":1, "parameter_specific_catalog":1, "parameter_specific_name":1, "parameter_specific_schema":1, "parameters":1, "partial":1, "partition":1, "pascal":1, "password":1, "path":1, "pctfree":1, "percent":1, "percent_rank":1, "percentile_cont":1, "percentile_disc":1, "placing":1, "plan":1, "pli":1, "position":1, "postfix":1, "power":1, "preceding":1, "precision":1, "prefix":1, "preorder":1, "prepare":1, "prepared":1, "preserve":1, "primary":1, "print":1, "prior":1, "privileges":1, "proc":1, "procedural":1, "procedure":1, "process":1, "processlist":1, "public":1, "purge":1, "quote":1, "raid0":1, "raiserror":1, "range":1, "rank":1, "raw":1, "read":1, "reads":1, "readtext":1, "real":1, "recheck":1, "reconfigure":1, "recursive":1, "ref":1, "references":1, "referencing":1, "regexp":1, "regr_avgx":1, "regr_avgy":1, "regr_count":1, "regr_intercept":1, "regr_r2":1, "regr_slope":1, "regr_sxx":1, "regr_sxy":1, "regr_syy":1, "reindex":1, "relative":1, "release":1, "reload":1, "rename":1, "repeat":1, "repeatable":1, "replace":1, "replication":1, "require":1, "reset":1, "resignal":1, "resource":1, "restart":1, "restore":1, "restrict":1, "result":1, "return":1, "returned_cardinality":1, "returned_length":1, "returned_octet_length":1, "returned_sqlstate":1, "returns":1, "revoke":1, "right":1, "rlike":1, "role":1, "rollback":1, "rollup":1, "routine":1, "routine_catalog":1, "routine_name":1, "routine_schema":1, "row":1, "row_count":1, "row_number":1, "rowcount":1, "rowguidcol":1, "rowid":1, "rownum":1, "rows":1, "rule":1, "save":1, "savepoint":1, "scale":1, "schema":1, "schema_name":1, "schemas":1, "scope":1, "scope_catalog":1, "scope_name":1, "scope_schema":1, "scroll":1, "search":1, "second":1, "second_microsecond":1, "section":1, "security":1, "select":1, "self":1, "sensitive":1, "separator":1, "sequence":1, "serializable":1, "server_name":1, "session":1, "session_user":1, "set":1, "setof":1, "sets":1, "setuser":1, "share":1, "show":1, "shutdown":1, "signal":1, "similar":1, "simple":1, "size":1, "smallint":1, "some":1, "soname":1, "source":1, "space":1, "spatial":1, "specific":1, "specific_name":1, "specifictype":1, "sql":1, "sql_big_result":1, "sql_big_selects":1, "sql_big_tables":1, "sql_calc_found_rows":1, "sql_log_off":1, "sql_log_update":1, "sql_low_priority_updates":1, "sql_select_limit":1, "sql_small_result":1, "sql_warnings":1, "sqlca":1, "sqlcode":1, "sqlerror":1, "sqlexception":1, "sqlstate":1, "sqlwarning":1, "sqrt":1, "ssl":1, "stable":1, "start":1, "starting":1, "state":1, "statement":1, "static":1, "statistics":1, "status":1, "stddev_pop":1, "stddev_samp":1, "stdin":1, "stdout":1, "storage":1, "straight_join":1, "strict":1, "string":1, "structure":1, "style":1, "subclass_origin":1, "sublist":1, "submultiset":1, "substring":1, "successful":1, "sum":1, "superuser":1, "symmetric":1, "synonym":1, "sysdate":1, "sysid":1, "system":1, "system_user":1, "table":1, "table_name":1, "tables":1, "tablesample":1, "tablespace":1, "temp":1, "template":1, "temporary":1, "terminate":1, "terminated":1, "textsize":1, "than":1, "then":1, "ties":1, "time":1, "timestamp":1, "timezone_hour":1, "timezone_minute":1, "tinytext":1, "to":1, "toast":1, "top":1, "top_level_count":1, "trailing":1, "tran":1, "transaction":1, "transaction_active":1, "transactions_committed":1, "transactions_rolled_back":1, "transform":1, "transforms":1, "translate":1, "translation":1, "treat":1, "trigger":1, "trigger_catalog":1, "trigger_name":1, "trigger_schema":1, "trim":1, "true":1, "truncate":1, "trusted":1, "tsequal":1, "type":1, "uescape":1, "uid":1, "unbounded":1, "uncommitted":1, "under":1, "undo":1, "unencrypted":1, "unique":1, "unknown":1, "unlisten":1, "unlock":1, "unnamed":1, "unnest":1, "unsigned":1, "until":1, "update":1, "updatetext":1, "upper":1, "usage":1, "use":1, "user":1, "user_defined_type_catalog":1, "user_defined_type_code":1, "user_defined_type_name":1, "user_defined_type_schema":1, "using":1, "utc_date":1, "utc_time":1, "utc_timestamp":1, "vacuum":1, "valid":1, "validate":1, "validator":1, "value":1, "values":1, "var_pop":1, "var_samp":1, "variable":1, "variables":1, "verbose":1, "view":1, "volatile":1, "waitfor":1, "when":1, "whenever":1, "where":1, "while":1, "width_bucket":1, "window":1, "with":1, "within":1, "without":1, "work":1, "write":1, "writetext":1, "x509":1, "xor":1, "year_month":1, "zerofill":1, "zone":1 }; var sqlpred={ "array":1, "bit":1, "any":1, "integer":1, "bitvar":1, "bool":1, "boolean":1, "bigint":1, "binary":1, "blob":1, "char":1, "character":1, "date":1, "datetime":1, "day":1, "hour":1, "double":1, "file":1, "int":1, "int1":1, "int2":1, "int3":1, "int4":1, "int8":1, "integer":1, "long":1, "longblob":1, "longtext":1, "minute":1, "number":1, "nullable":1, "numeric":1, "object":1, "octets":1, "tinyblob":1, "tinyint":1, "text":1, "union":1, "varbinary":1, "varchar":1, "varchar2":1, "varcharacter":1, "varying":1, "year":1 }; var lang={ "html":{ "style": { "code":"html", "plain":"phtml" } }, "css":{ "style": { "code":"css", "plain":"pcss" }, "op":cssop, "keyw":csskeyw, "pred":csspred, "keyw_sensitive":true, "pred_sensitive":true }, "js":{ "style": { "code":"js", "plain":"pjs" }, "op":jsop, "keyw":jskeyw, "pred":jspred, "keyw_sensitive":true, "pred_sensitive":true }, "php":{ "style": { "code":"php", "plain":"pphp" }, "op":phpop, "keyw":phpkeyw, "pred":phppred, "keyw_sensitive":false, "pred_sensitive":true }, "sql":{ "style": { "code":"sql", "plain":"psql" }, "op":sqlop, "keyw":sqlkeyw, "pred":sqlpred, "keyw_sensitive":false, "pred_sensitive":false } }; lang["javascript"]=lang["js"]; function filePos(fname,li,col) { return {"fname":fname,"li":li,"col":col}; } function filePosDup(fpos) { return filePos(fpos.fname,fpos.li,fpos.col); } function filePosLiCol(fpos,li,col) { fpos.li=li; fpos.col=col; } function filePosSerialize(fpos) { var res=""; if (fpos.fname!=null) res+=fpos.fname+", "; res+="line "+fpos.li+", col "+fpos.col; return res; } var _errorFilePos=null; function errorPos() { if (_errorFilePos==null) return null; return filePosDup(_errorFilePos); } function errorFileName() { if (_errorFilePos==null) return null; return _errorFilePos.fname; } function errorLi() { if (_errorFilePos==null) return 0; return _errorFilePos.li; } function errorCol() { if (_errorFilePos==null) return 0; return _errorFilePos.col; } function errorSetPos(fname,li,col) { _errorFilePos=filePos(fname,li,col); } function errorSetLiCol(li,col) { if (_errorFilePos==null) return; filePosLiCol(_errorFilePos,li,col); } function errorResetPos() { _errorFilePos=null; } var SERVER=false; function stop(errno) { if (SERVER) process.exit(errno); else zboc(1); } function error(msg) { if (_errorFilePos!=null) msg+=" --> "+filePosSerialize(_errorFilePos); (SERVER?console.log:alert)(msg); stop(1); } function ftrue() { return true; } function ffalse() { return false; } function ftrue1(a,b) { return true; } function ffalse1(a,b) { return false; } function ftrue2(a,b) { return true; } function ffalse2(a,b) { return false; } function _proto(X) { return X.constructor.prototype; } function isNull(o) { return o==null; } function isBoolean(o) { return o!=null && _proto(o)==_proto(true); } function isNumber(o) { return o!=null && _proto(o)==_proto(1); } function isString(o) { return o!=null && _proto(o)==_proto("A"); } function isArray(o) { return o!=null && _proto(o)==_proto([]); } function isDictionary(o) { return o!=null && _proto(o)==_proto({}); } function isFunction(X) { return _proto(X)==_proto(function() {}); } function out(s) { document.write(s); } function br(s) { out("
"); } function hr(s) { out("
"); } function stringEscape(s) { var res=""; for (var i=0;i0) res+="|"; res+=display(o[i]); } res+="]"; displaying.pop(); } else if (isDictionary(o)) { displaying.push(o); res="{"; var first=true; for (var val in o) { if (!first) res+="|"; else first=false; if (val!="parent") { res+=val+"="+display(o[val]); } } res+="}"; displaying.pop(); } return res; } function asc(ch) { return ch.charCodeAt(0)&255; } function chr(i) { return String.fromCharCode(i); } function trim(s,chars,left,right) { if (chars==undefined) chars=" "; if (left==undefined) left=true; if (right==undefined) right=true; var res="",a=s.split(""),i; if (left) { i=0; while (i=0 && chars.indexOf(a[i])!=-1) { a[i]=null; i--; } } for (i=0;i0 && charIs(a[i0][0],BLANK)) i0++; if (right) while (j0>0 && isString(a[j0-1]) && length(a[j0-1])>0 && charIs(a[j0-1][0],BLANK)) j0--; return arrayCopy(a,i0,j0); } function argvRemove(argv,j) { splice(argv,j,1,[]); } var UNKNOWN=0,ALPHANUM=1,OPCHAR=2,SPLITTER=3,BLANK=4,QUOTE=5,DQUOTE=6; var charnat=[]; function charIs(ch,nat) { return charnat[asc(ch)]==nat; } function charIsDigit(ch) { return ch=="1" || ch=="2" || ch=="3" || ch=="4" || ch=="5" || ch=="6" || ch=="7" || ch=="8" || ch=="9" || ch=="0"; } var buf,ptr; function bufEof() { return ptr>=buf.length; } var _ptrNextCount=true; function ptrNext() { var li=errorLi(),col=errorCol(); if (buf[ptr]=='\n') li++,col=1; else col++; if (_ptrNextCount) errorSetLiCol(li,col); ptr++; } function ptrNextN(n) { while (n--) ptrNext(); } function find(nat) { while (ptr=buf.length+str.length-1) ptr=buf.length; } function skip(nat) { while (ptr=buf.length) errorSetLiCol(li,col),error("Unterminated comment"); ptrNextN(2); res=buf.substring(ptr0,ptr); } else if (buf.substring(ptr,ptr+2)=="//") { var li=errorLi(),col=errorCol(); findString("\n"); if (ptr=buf.length) errorSetLiCol(li,col),error("Unterminated string"); ptrNext(); res=buf.substring(ptr0,ptr); } if (res==null) errorSetLiCol(li,col),error("Unknown element: "+buf[ptr]+";;"+charnat[asc(buf[ptr])]); } } return res; } function tokenize() { var s,res=[]; do { s=next(false,false); if (s!=null) res.push(s); } while (s!=null); return res; } function bufstart(txt) { buf=txt; ptr=0; } function scriptTokenize(code) { var oldbuf=buf,oldptr=ptr,oldfpos=errorPos(); bufstart(code); var s,res=[]; do { s=next(false,false); if (s!=null) res.push(s); } while (s!=null); buf=oldbuf;ptr=oldptr; if (oldfpos!=null) errorSetPos(oldfpos.fname,oldfpos.li,oldfpos.col); return res; } function tagCreate(state,tag,elts,li,col) { if (li==undefined) li=-1; if (col==undefined) col=-1; return {"state":state,"parent":null,"tag":tag,"attrs":{},"elts":elts,"licol":[li,col]}; } function isXmlPI(tag) { return isDictionary(tag) && tag.state=="?" && !isHtmlComment(tag); } function isHtmlComment(tag) { return isDictionary(tag) && tag.state=="?" && tag.tag=="!--"; } function isOpeningTag(tag) { return isDictionary(tag) && tag.state=="<"; } function isClosingTag(tag) { return isDictionary(tag) && tag.state==">"; } function isCDataTag(tag) { return isDictionary(tag) && cdata[tag.tag]; } function isOptCloseTag(tag) { return isDictionary(tag) && optclose[tag.tag]; } function isSelfClosingTag(tag) { return isDictionary(tag) && tag.state==""; } function isTag(tag,name,attr,fval) { if (!isDictionary(tag) || !(tag.state=="<>" || tag.state=="<") || tag.tag!=name) return false; return fval(attrVal(tag.attrs[attr])); } function tagAdd(tag,elt) { tag.elts.push(elt); if (isDictionary(elt)) elt.parent=tag; } function tagReplace(dest,src) { if (!isDictionary(dest) || !isDictionary(src)) error("tagReplace"); dest.state=src.state; dest.tag=src.tag; dest.attrs=src.attrs; dest.elts=src.elts; } function treeCopy(p,t) { var res=t; if (isString(t)) ; else if (isDictionary(t)) { res={"state":t.state,"parent":p,"tag":t.tag,"attrs":{},"elts":[]}; for (var n in t.attrs) res.attrs[n]=t.attrs[n]; for (var i=0;i' expected []"); } } function htmlNext() { if (ptr>=buf.length) return null; var li=errorLi(),col=errorCol(), str=next(false,true); if (str!="<") res=str; else tag: { var opn=charnat[asc("+")]; charnat[asc("+")]=ALPHANUM; str=next(true,false); charnat[asc("+")]=opn; if (str=="/") { opn=charnat[asc("+")]; charnat[asc("+")]=ALPHANUM; str=next(true,false); charnat[asc("+")]=opn; res=tagCreate(">",str,[],li,col); li=errorLi(),col=errorCol(); str=next(true,false); if (str!=">") errorSetLiCol(li,col),error("'>' expected []"); } else if (cdata[str] || str=="code") { res=tagCreate("?",str,"",li,col); var end="",end2=chr(255); if (str=="!--?php") { end="?-->";res.tag="?php"; } else if (str[0]=="?") end="?>"; else if (str=="!--") { end="-->";res.tag="!--"; } else if (str[0]=="!") end=">"; else { res.state="<>"; end=""; end2=""; tagReadAttrs(res); if (isTag(res,"script","language", function(lang) { return isString(lang) && contains(lang,"html"); })) { res.state="<";res.elts=[]; break tag; } } var ptr0=ptr; str=cdataNext(end,end2); if (str==null && end=="?-->") { ptr=ptr0; str=cdataNext(end="?>",""); if (str!=null) { var i=str.indexOf("-->"); str=str.substring(0,i)+str.substring(i+2,str.length); } } if (str==null) errorSetLiCol(li,col),error("'"+end+"' expected"); res.elts=str; if (buf.substring(ptr,ptr+end.length)==end) ptrNextN(end.length); if (buf.substring(ptr,ptr+end2.length)==end2) ptrNextN(end2.length); } else { res=tagCreate("<",str,[],li,col); tagReadAttrs(res); } } return res; } function htmlTokenize() { var s,res=[]; do { s=htmlNext(); if (s!=null) res.push(s); } while (s!=null); return res; } function htmlParse(fpos) { if (fpos!=undefined) errorSetPos(fpos.fname,fpos.li,fpos.col); var elt,res=[tagCreate("<>","",[])]; var finished=false; var finalize=function() { var closed=res.pop(); closed.state="<>"; if (empty(res)) { res=closed; finished=true; } else tagAdd(last(res),closed); }; do { var li=errorLi(),col=errorCol(); elt=htmlNext(); if (elt!=null) { var scripth=isTag(elt,"script","language", function(lang) { return isString(lang) && contains(lang,"html"); }); if (!scripth && (isCDataTag(elt) && !isHtmlComment(elt) || elt.tag=="code")) { elt.elts=scriptTokenize(elt.elts); } if (!scripth && (isString(elt) || isSelfTag(elt) || elt.tag=="code")) { tagAdd(last(res),elt); } else if (isOpeningTag(elt)) res.push(elt); else if (isClosingTag(elt)) { var closed=null; while (last(res).tag!=elt.tag) { closed=res.pop(); if (closed.state=="<" && !isOptCloseTag(closed)) { errorSetLiCol(closed.licol[0],closed.licol[1]); error("Missing closing tag for <"+closed.tag+">"); } if (last(res)==null) errorSetLiCol(li,col),error("Lone closing tag"); tagAdd(last(res),closed); } finalize(); } else errorSetLiCol(li,col),error("Unknown case"); } } while (elt!=null && !finished); if (htmlNext()!=null) error("Markup found past end"); errorResetPos(); return res[0]; } function htmlDisplay(o) { displaying=[o.parent]; var res=display(o); displaying=[]; return res; } function scriptRaw(code) { var res=""; for (var i=0;i"; } } var elt=html.elts; if (html.tag=="!--") res+=elt; else if (html.tag=="script") res+=scriptRaw(elt); else if (elt) { for (var i=0;i"; if (isHtmlComment(html)) res+="-->"; if (isXmlPI(html)) if (html.tag[0]=="!") res+=">"; else res+="?>"; } if (!elt) res=""; } else if (isString(html)) { if (prewrap && contains(html,"\n")) { html=replaceAll(html,"\n","
"); } res=html; } return res; } function htmlEscapeChars(html) { var res=""; for (var i=0;i') c=">"; if (c=='&') c="&"; res+=c; } return res; } function htmlEscapeBlanks(html) { var res=""; for (var i=0;i "; res+=c; } return res; } function htmlSpan(categ,txt) { return ""+txt+""; } function htmls(cla) { return (scriptStyleName=="plain"?"p":"")+"html "+cla; } function attrVal(val) { if (val==undefined || val==null) val=""; return trim(trim(trim(val,"'",true,true),"\"",true,true)," ",true,true); } function attrLang(lang) { lang=attrVal(lang); lang=trim(replaceAll(lang,"inactive","")," ",true,true); return lang; } function htmlPretty(html) { var res=""; if (isDictionary(html)) { if (html.tag[0]=="\\" || length(html.tag)>1 && html.tag[1]=="\\") { html.tag=replaceAll(html.tag,"\\",""); } if (html.tag!="" && html.attrs["foldtag"]==undefined) { res=htmlSpan(isHtmlComment(html)?htmls("Comment"):isXmlPI(html)?htmls("xmlPI"):htmls("Tag"), "<"+html.tag); var attrs=html.attrs; if (!empty(attrs)) { for (var n in attrs) { if (n[0]!="$") { var val=attrs[n]; if (!SERVER) val=htmlEscapeChars(val); res+=" "+ htmlSpan(htmls("Attr"),n)+ htmlSpan(htmls("Tag"),"=")+ htmlSpan(htmls("AttrVal"),val); } } } if (!isHtmlComment(html) && !isXmlPI(html)) { res+=htmlSpan(htmls("Tag"),(isSelfClosingTag(html)?"/":"")+">"); } } var elt=html.elts, lang=attrLang(html.attrs["language"]); if (html.tag=="!--") res+=htmlSpan(htmls("CommentContent"),elt); else if (html.tag=="?php") { enterScriptPretty("php",scriptStyleName); res+=scriptPretty(elt); leaveScriptPretty(); } else if (html.tag=="script" && lang!="html") { if (lang=="") lang="javascript"; if (!scriptLangExists(lang)) error("Unknown language: "+lang); enterScriptPretty(lang,scriptStyleName); res+=scriptPretty(elt); leaveScriptPretty(); } else if (elt) { for (var i=0;i"); } tok=replaceAll(tok,"\\\\","&zboc;"); tok=replaceAll(tok,"&zboc;","\\"); return tok; } function scriptPrettyElt(tok) { var categ=scripts("Symbol"); tok=scriptReplaceEscapedSymbs(tok,true); if (charIs(tok[0],BLANK)) return htmlEscapeBlanks(tok); if (tok[0]=="'" || tok[0]=='"') { tok=scriptMarkVars(htmlEscapeBlanks(htmlEscapeChars(tok)));categ=scripts("ConstString"); } if (charIsDigit(tok[0])) { categ=scripts("ConstString"); } if (tok.length>=2 && tok[0]=="/" && tok[1]=='*') categ=scripts("Comment"); if (tok.length>=2 && tok[0]=="/" && tok[1]=='/') { categ=scripts("Comment"); tok=trim(tok,"\n",false,true);tok+="
"; } if (tok.length>=1 && false && tok[0]=="#") { categ=scripts("Comment"); tok=trim(tok,"\n",false,true);tok+="
"; } if (tok.length>=1 && tok[0]=="-" && tok[1]=="-" && scriptLang=="sql") { categ=scripts("Comment"); tok=trim(tok,"\n",false,true);tok+="
"; } if (isScriptOp(tok)) categ=scripts("Operator"); if (isScriptKeyw(tok)) categ=scripts("Keyword"); if (isScriptPred(tok)) categ=scripts("Predef"); if (tok[0]=="$" && false) categ=scripts("Variable"); // FIXME: should test script language==PHP return htmlSpan(categ,tok); } function scriptPretty(code) { var res=""; for (var i=0;i
"+hilite_scriptRaw(lang,style,text)+ "
"; } else return ""; } function hilite_script(attrs,text) { return hilite_scriptCooked(attrVal(attrs["language"]),"code",text); } var hilite_plaintextAttrs=transformCreate(), hilite_plaintextMarkup=transformCreate(); function attrLang(lang) { lang=attrVal(lang); lang=trim(replaceAll(lang,"vars","")," ",true,true); lang=trim(replaceAll(lang,"predefs","")," ",true,true); lang=trim(replaceAll(lang,"names","")," ",true,true); lang=trim(replaceAll(lang,"inactive","")," ",true,true); return lang; } function blockCla(tag,cla) { if (cla==null) cla=""; cla=attrVal(cla).split(" "); var i=index(cla,"inline"); if (i!=-1) cla[i]="Inline"; else { i=index(cla,"block"); if (i!=-1) cla[i]="Block"; else cla.push(tag=="code"?"Block":"Inline"); } return "\""+cla.join(" ")+"\""; } function plainLang(node,lang) { var tag=node.tag; node.tag="span"; var node2=tagCreate("<","",[]); node2.elts=node.elts; var html=hilite_scriptRaw(lang,"plain",htmlSerialize(node2)); node.elts=[html]; var cla=node.attrs["class"]; node.attrs["class"]=blockCla(tag,cla); return node; } function hilite_plaintextInit() { transformAddRule(hilite_plaintextAttrs,function(node,attrs) { var lang=attrVal(node.attrs["language"]); if (lang!="") node.attrs["$hilang"]='"'+lang+'"'; return node; }); transformAddRule(hilite_plaintextAttrs,function(node,attrs) { if (node.tag=="var" || node.tag=="vars") { node.attrs["$hivars"]=true; node.attrs["$hipredefs"]=false; } return node; }); transformAddRule(hilite_plaintextAttrs,function(node,attrs) { if (node.tag=="predef" || node.tag=="predefs") { node.attrs["$hivars"]=false; node.attrs["$hipredefs"]=true; } return node; }); transformAddRule(hilite_plaintextAttrs,function(node,attrs) { if (node.tag=="name" || node.tag=="names") { node.attrs["$hivars"]=true; node.attrs["$hipredefs"]=true; } return node; }); transformAddRule(hilite_plaintextAttrs,function(node,attrs) { if (node.tag=="ltt") { node.attrs["$hivars"]=true; node.attrs["$hipredefs"]=false; var lang=attrLang(node.attrs["$hilang"]); foreach_text(node,function(node,attrs) { var res=node,tt=false; if (node!="," && node!=";" && !charIs(node,BLANK)) tt=true; if (tt) { var s=res; res=tagCreate("<>","tt",[]); if (lang!="") enterScriptPretty(lang,"plain"); res.attrs["class"]="\""+scriptStyle+" ListOfTT\""; if (lang!="") leaveScriptPretty(); res.attrs["$hivars"]=true; res.elts.push(s); } return res; }); } return node; }); transformAddRule(hilite_plaintextAttrs,function(node,attrs) { if (node.tag=="script" || node.tag=="code" || node.tag=="c" || contains(node.tag,"htm") || contains(node.tag,"css") || contains(node.tag,"js") || contains(node.tag,"php") || contains(node.tag,"sql")) { node.attrs["$hivars"]=false; node.attrs["$hipredefs"]=false; } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { var tag=node.tag; if (tag=="c" || tag=="code") { var lang=attrLang(node.attrs["$hilang"]); node=plainLang(node,lang); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="htm" || node.tag=="htm+code" || node.tag=="code+htm") { if (contains(node.tag,"code")) node.tag="code"; node=plainLang(node,"html"); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="css" || node.tag=="css+code" || node.tag=="code+css") { if (contains(node.tag,"code")) node.tag="code"; node=plainLang(node,"css"); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="js" || node.tag=="js+code" || node.tag=="code+js") { if (contains(node.tag,"code")) node.tag="code"; node=plainLang(node,"javascript"); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="php" || node.tag=="php+code" || node.tag=="code+php") { if (contains(node.tag,"code")) node.tag="code"; node=plainLang(node,"php"); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="sql" || node.tag=="sql+code" || node.tag=="code+sql") { if (contains(node.tag,"code")) node.tag="code"; node=plainLang(node,"sql"); } return node; }); transformAddRule(hilite_plaintextMarkup,function(node,attrs) { if (node.tag=="script") { node.attrs["foldtag"]=1; node.elts=arrayTrim(node.elts,true,true); node=tagCreate("<>","td",[node]); node.attrs["class"]="\"hilite\""; node=tagCreate("<>","tr",[node]); node=tagCreate("<>","table",[node]); node=tagCreate("<>","code",[node]); foreach_cut(); } return node; }); } function hilite_plaintextNames(node,attrs) { foreach_text(node,function(node,attrs) { var res=node; if (length(node)>1 && node[0]=="\\" && node[1]!="\\") res=node.substring(1,node.length); res=scriptReplaceEscapedSymbs(res,false); if (isScriptVar(node) && attrs.attrs["$hivars"]) res=scriptPrettyVar(node); else if (isScriptPred(node) && attrs.attrs["$hipredefs"]) res=scriptPrettyPredef(node); return res; }); return node; } var hilite_prewrap=false; function hilite_hilite(attrs,text) { var lang=attrVal(attrs["language"]),res; if (isString(lang) && startsWith(lang,"inactive")) res=hilite_script(attrs,text); else { var vars=true,predefs=false; if (lang==undefined || lang==null || lang=="") lang="html"; else { if (contains(lang,"vars")) lang=trim(replaceAll(lang,"vars","")," ",true,true),vars=true; else vars=false; if (contains(lang,"predefs")) lang=trim(replaceAll(lang,"predefs","")," ",true,true),predefs=true; if (contains(lang,"names")) lang=trim(replaceAll(lang,"names","")," ",true,true),vars=predefs=true; } if (!scriptLangExists(lang)) error("Unknown language: "+lang+"[["+attrs["language"]+"]]"); var tree; if (isString(text)) { hilite_init(); bufstart(text); tree=htmlParse(); } else tree=tagCreate(text.state,"",text.elts); tree.attrs["$hilang"]=lang; inherit_attrs(tree,tree); transform(tree,hilite_plaintextAttrs); tree.attrs["$hivars"]=vars; tree.attrs["$hipredefs"]=predefs; inherit_attrs(tree,tree); enterScriptPretty(lang,"plain"); hilite_plaintextNames(tree,tree); leaveScriptPretty(); transform(tree,hilite_plaintextMarkup); if (hilite_prewrap) tree.elts=arrayTrim(tree.elts,true,true); res=htmlSerializePlainText(tree,hilite_prewrap); } return res; } function hiliteInit(prewrap) { hilite_plaintextInit(); hilite_prewrap=prewrap; dom_transform("hilite",hilite_hilite); dom_transform("script",hilite_script); window.document.body.style.display="block"; } function installOnload(f) { var oldf=window.onload; if (typeof oldf!='function') window.onload=f; else { window.onload=function() { oldf(); f(); } } } installOnload(function() { hiliteInit(false); });