module documentation
babel.messages.jslexer ~~~~~~~~~~~~~~~~~~~~~~ A simple JavaScript 1.5 lexer which is used for the JavaScript extractor. :copyright: (c) 2013-2023 by the Babel Team. :license: BSD, see LICENSE for more details.
Class |
|
Undocumented |
Function | get |
Get a tokenization rule list given the passed syntax options. |
Function | indicates |
A helper function that helps the tokenizer to decide if the current token may be followed by a division operator. |
Function | tokenize |
Tokenize JavaScript/JSX source. Returns a generator of tokens. |
Function | unquote |
Unquote a string with JavaScript rules. The string has to start with string delimiters (``'``, ``"`` or the back-tick/grave accent (for template strings).) |
Variable | division |
Undocumented |
Variable | dotted |
Undocumented |
Variable | escapes |
Undocumented |
Variable | hex |
Undocumented |
Variable | line |
Undocumented |
Variable | line |
Undocumented |
Variable | name |
Undocumented |
Variable | operators |
Undocumented |
Variable | regex |
Undocumented |
Variable | uni |
Undocumented |
Variable | _rules |
Undocumented |
def get_rules(jsx:
bool
, dotted: bool
, template_string: bool
) -> list[ tuple[ str|None, re.Pattern[ str]]]
:
(source)
¶
Get a tokenization rule list given the passed syntax options. Internal to this module.
A helper function that helps the tokenizer to decide if the current token may be followed by a division operator.
def tokenize(source:
str
, jsx: bool
= True, dotted: bool
= True, template_string: bool
= True, lineno: int
= 1) -> Generator[ Token, None, None]
:
(source)
¶
Tokenize JavaScript/JSX source. Returns a generator of tokens. :param jsx: Enable (limited) JSX parsing. :param dotted: Read dotted names as single name token. :param template_string: Support ES6 template strings :param lineno: starting line number (optional)