3
V'ícõ ã @ s¾ d Z ddlZddlmZmZmZmZmZmZm Z m
Z
mZmZm
Z
mZ ddlmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddljZdddd d
ddd
ddddgZ dej!dddddd d Z"dej!dddddddddd
d Z#e"d e# d! Z$G d"d de
Z%G d#d
d
e%Z&G d$d de
Z'G d%d de
Z(G d&d d e
Z)G d'd de
Z*G d(d de
Z+G d)d
d
e
Z,G d*d de
Z-G d+d de
Z.G d,d de
Z/G d-d de Z0dS ).zå
pygments.lexers.javascript
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for JavaScript and related languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)ÚbygroupsÚcombinedÚdefaultÚ
do_insertionsÚincludeÚinheritÚLexerÚ
RegexLexerÚthisÚusingÚwordsÚline_re)ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚOtherÚGenericÚ
Whitespace)Úget_bool_optÚJavascriptLexerÚKalLexerÚLiveScriptLexerÚ DartLexerÚTypeScriptLexerÚ
LassoLexerÚObjectiveJLexerÚCoffeeScriptLexerÚ MaskLexerÚ
EarlGreyLexerÚJuttleLexerÚNodeConsoleLexerz(?:[$_ZLuZLlÚLtZLmZLoZNlz]|\\u[a-fA-F0-9]{4})z(?:[$ZMnZMcZNdZPcu ââ]|\\u[a-fA-F0-9]{4})z(?:z)*c @ s¬ e Zd ZdZdZdZddgZdddd gZd
ddd
gZe j
e jB Zde
fdefdejfdejfgeddejdfded;fedgde
dfgdejfdedfeddejfdejfdejfdejfdejfd efd!edfd"edfd#efd$ejdfd%e j!fd&e dfd'e j"dfd(e j!fd)e j#fd*e$j%fd+e$j&fd,e'e e
dfd-e$j(dfe)e$j(fd.ej*fd/ejfd0ej+d1fgd0ej+dfd2ej+fd3ej,d4fd5ej+fd6ej+fgd7ej,dfed8gd9Z-d:S )<r z%
For JavaScript source code.
Z
JavaScriptzQhttps://www.ecma-international.org/publications-and-standards/standards/ecma-262/Z
javascriptZjsz*.jsz*.jsmz*.mjsz*.cjszapplication/javascriptzapplication/x-javascriptztext/x-javascriptztext/javascriptz\s+z<!--z//.*?$z /\*.*?\*/Úcommentsandwhitespacez7/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gimuysd]+\b|\B)ú#popz(?=/)Úbadregexz\nz\A#! ?/.*?$z^(?=\s|/|<!--)Úslashstartsregexz0[bB][01]+n?z0[oO]?[0-7]+n?z0[xX][0-9a-fA-F]+n?z[0-9]+nz2(\.[0-9]+|[0-9]+\.[0-9]*|[0-9]+)([eE][-+]?[0-9]+)?z \.\.\.|=>zP\+\+|--|~|\?\?=?|\?|:|\\(?=\n)|(<<|>>>?|==?|!=?|(?:\*\*|\|\||&&|[-<>+*%&|^/]))=?z[{(\[;,]z[})\].]z((typeof|instanceof|in|void|delete|new)\bz\b(constructor|from|as)\bz£(for|in|while|do|break|return|continue|switch|case|default|if|else|throw|try|catch|finally|yield|await|async|this|of|static|export|import|debugger|extends|super)\bz%(var|let|const|with|function|class)\bz®(abstract|boolean|byte|char|double|enum|final|float|goto|implements|int|interface|long|native|package|private|protected|public|short|synchronized|throws|transient|volatile)\bz*(true|false|null|NaN|Infinity|undefined)\ba (Array|Boolean|Date|BigInt|Function|Math|ArrayBuffer|Number|Object|RegExp|String|Promise|Proxy|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|DataView|document|window|globalThis|global|Symbol|Intl|WeakSet|WeakMap|Set|Map|Reflect|JSON|Atomics|Int(?:8|16|32)Array|BigInt64Array|Float32Array|Float64Array|Uint8ClampedArray|Uint(?:8|16|32)Array|BigUint64Array)\bz;((?:Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\bz (super)(\s*)(\([\w,?.$\s]+\s*\))z!([a-zA-Z_?.$][\w?.$]*)(?=\(\) \{)z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*'ú`Úinterpz\\.z\$\{z
interp-insidez\$z[^`\\$]+z\}Úroot)r'