Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var JavaScriptHighlightRules = function() {
var docComment = new DocCommentHighlightRules();
var keywords = lang.arrayToMap(
("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
"const|yield|import|get|set").split("|")
);
var buildinConstants = lang.arrayToMap(
("null|Infinity|NaN|undefined").split("|")
);
var futureReserved = lang.arrayToMap(
("class|enum|extends|super|export|implements|private|" +
"public|interface|package|protected|static").split("|")
);
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
docComment.getStartRule("doc-start"),
{
token : "comment", // multi line comment
var ScalaHighlightRules = function() {
// taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
var keywords = lang.arrayToMap(
(
"case|default|do|else|for|if|match|while|throw|return|try|catch|finally|yield|" +
"abstract|class|def|extends|final|forSome|implicit|implicits|import|lazy|new|object|" +
"override|package|private|protected|sealed|super|this|trait|type|val|var|with"
).split("|")
);
var buildinConstants = lang.arrayToMap(
("true|false").split("|")
);
var langClasses = lang.arrayToMap(
("AbstractMethodError|AssertionError|ClassCircularityError|"+
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
"ExceptionInInitializerError|IllegalAccessError|"+
"IllegalThreadStateException|InstantiationError|InternalError|"+
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
"SuppressWarnings|TypeNotPresentException|UnknownError|"+
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
"InstantiationException|IndexOutOfBoundsException|"+
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
"fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
"time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
"select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
"file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
"protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
"send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
"validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
"validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
"authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
"filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
"translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|" +
"cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
"has_many|has_one|belongs_to|has_and_belongs_to_many").split("|")
);
var keywords = lang.arrayToMap(
("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
"__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
"redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield").split("|")
);
var buildinConstants = lang.arrayToMap(
("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
"RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING").split("|")
);
var builtinVariables = lang.arrayToMap(
("\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" +
"$!|root_url|flash|session|cookies|params|request|response|logger").split("|")
);
// regexp must not have capturing parentheses. Use (?:) instead.
var PythonHighlightRules = function() {
var keywords = lang.arrayToMap(
("and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
"finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
"raise|return|try|while|with|yield").split("|")
);
var builtinConstants = lang.arrayToMap(
("True|False|None|NotImplemented|Ellipsis|__debug__").split("|")
);
var builtinFunctions = lang.arrayToMap(
("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
"eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
"binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
"float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
"chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
"cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
"__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
"buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern").split("|")
);
var futureReserved = lang.arrayToMap(
("").split("|")
);
var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
);
var stdLibaries = lang.arrayToMap(
("string|package|os|io|math|debug|table|coroutine").split("|")
);
var metatableMethods = lang.arrayToMap(
("__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
"__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber").split("|")
);
var futureReserved = lang.arrayToMap(
("").split("|")
);
var deprecatedIn5152 = lang.arrayToMap(
("setn|foreach|foreachi|gcinfo|log10|maxn").split("|")
);
var strPre = "";
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
var fraction = "(?:\\.\\d+)";
var intPart = "(?:\\d+)";
var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
var floatNumber = "(?:" + pointFloat + ")";
var comment_stack = [];
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
);
var functions = lang.arrayToMap(
("rgb|rgba|url|attr|counter|counters").split("|")
);
var constants = lang.arrayToMap(
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
"reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
"loaders|cpath|config|path|seeall|exit|setlocale|date|"+
"getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
"lines|write|close|flush|open|output|type|read|stderr|"+
"stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
"ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
"frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
"atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
"gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
"setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
"foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
"status|wrap|create|running").split("|")
);
var stdLibaries = lang.arrayToMap(
("string|package|os|io|math|debug|table|coroutine").split("|")
);
var metatableMethods = lang.arrayToMap(
("__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
"__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber").split("|")
);
var futureReserved = lang.arrayToMap(
("").split("|")
);
var deprecatedIn5152 = lang.arrayToMap(
("setn|foreach|foreachi|gcinfo|log10|maxn").split("|")
);
var PerlHighlightRules = function() {
var keywords = lang.arrayToMap(
("base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
"no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars").split("|")
);
var buildinConstants = lang.arrayToMap(
("ARGV|ENV|INC|SIG").split("|")
);
var builtinFunctions = lang.arrayToMap(
("getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
"gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
"getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
"endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
"getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
"localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
"closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
"assert|default|goto|package|synchronized|" +
"boolean|do|if|private|this|" +
"break|double|implements|protected|throw|" +
"byte|else|import|public|throws|" +
"case|enum|instanceof|return|transient|" +
"catch|extends|int|short|try|" +
"char|final|interface|static|void|" +
"class|finally|long|strictfp|volatile|" +
"const|float|native|super|while").split("|")
);
var buildinConstants = lang.arrayToMap(
("null|Infinity|NaN|undefined").split("|")
);
var langClasses = lang.arrayToMap(
("AbstractMethodError|AssertionError|ClassCircularityError|"+
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
"ExceptionInInitializerError|IllegalAccessError|"+
"IllegalThreadStateException|InstantiationError|InternalError|"+
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
"SuppressWarnings|TypeNotPresentException|UnknownError|"+
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
"InstantiationException|IndexOutOfBoundsException|"+
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
var RubyHighlightRules = function() {
var builtinFunctions = lang.arrayToMap(
("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
"assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
"assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
"assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
"assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
"assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
"attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
"caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
"exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
"gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|" +
"link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
"p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
"raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
"set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
"throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
"render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +