3
X'íc ã , @ sÐ d Z ddlmZ ddlZedddddd d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g+ed/d0Zd1d2d3d4d5d6Zejd7ej Z
ejd8ej Zejd9Zejd:ej
Zejd;Zejd<ej Zejd=Zejd>Zed?d@ZdejdAej fdejdBfdCejdDfdEejdFej ej
B fdGefdHe
fdIejdJejfdKejdLejfdMejdNdjeeje fdOejdPej fdQejdRejej
B fgZdSdT ZdUdV ZdWdX Zd[dYdZZdS )\zí
babel.messages.jslexer
~~~~~~~~~~~~~~~~~~~~~~
A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.
:copyright: (c) 2013-2022 by the Babel Team.
:license: BSD, see LICENSE for more details.
é )Ú
namedtupleNú+ú-Ú*ú%z!=z==ú<ú>z<=z>=ú=z+=z-=z*=z%=z<<z>>z>>>z<<=z>>=z>>>=ú&z&=ú|z|=z&&z||ú^z^=ú(ú)ú[ú]Ú{Ú}ú!z--z++ú~ú,ú;Ú.ú:T)ÚkeyÚreverseúúÚ
ú
ú )ÚbÚfÚnÚrÚtz[\w$_][\w\d$_]*z[\w$_][\w\d$_.]*[\w\d$_.]z/=?z%/(?:[^/\\]*(?:\\.[^/\\]*)*)/[a-zA-Z]*z(\r\n|\n|\r)z\\z[a-fA-F0-9]{1,4}z[a-fA-F0-9]{1,2}ÚTokenztype value linenoz\s+z<!--.*Zlinecommentz//.*Zmultilinecommentz /\*.*?\*/Údotted_nameÚnameÚnumberzb(
(?:0|[1-9]\d*)
(\.\d+)?
([eE][-+]?\d+)? |
(0x[a-fA-F0-9]+)
)Zjsx_tagz(?:</?[^>\s]+|/>)Úoperatorz(%s)Útemplate_stringz`(?:[^`\\]*(?:\\.[^`\\]*)*)`ÚstringzT(
'(?:[^'\\]*(?:\\.[^'\\]*)*)' |
"(?:[^"\\]*(?:\\.[^"\\]*)*)"
)c C s^ g }xTt D ]L\}}| r&|r&d|kr&q
| r6|dkr6q
|dkrH|sDq
d}|j||f q
W |S )ze
Get a tokenization rule list given the passed syntax options.
Internal to this module.
Újsxr* r&