module documentation

A simple JavaScript 1.5 lexer which is used for the JavaScript extractor.

Unknown Field: copyright
  1. 2013-2021 by the Babel Team.
Unknown Field: license
BSD, see LICENSE for more details.
Variable division​_re Undocumented
Variable dotted​_name​_re Undocumented
Variable escapes Undocumented
Variable line​_join​_re Undocumented
Variable line​_re Undocumented
Variable name​_re Undocumented
Variable operators Undocumented
Variable regex​_re Undocumented
Variable ​Token Undocumented
Variable uni​_escape​_re Undocumented
Function get​_rules Get a tokenization rule list given the passed syntax options.
Function indicates​_division 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​_string Unquote a string with JavaScript rules. The string has to start with string delimiters (', " or the back-tick/grave accent (for template strings).)
Variable ​_rules Undocumented
division_re =

Undocumented

dotted_name_re =

Undocumented

escapes: dict[str, str] =

Undocumented

line_join_re =

Undocumented

line_re =

Undocumented

name_re =

Undocumented

operators =

Undocumented

regex_re =

Undocumented

Token =

Undocumented

uni_escape_re =

Undocumented

def get_rules(jsx, dotted, template_string):

Get a tokenization rule list given the passed syntax options.

Internal to this module.

def indicates_division(token):
A helper function that helps the tokenizer to decide if the current token may be followed by a division operator.
def tokenize(source, jsx=True, dotted=True, template_string=True):
Tokenize JavaScript/JSX source. Returns a generator of tokens.
Parameters
sourceUndocumented
jsxEnable (limited) JSX parsing.
dottedRead dotted names as single name token.
template​_stringSupport ES6 template strings
def unquote_string(string):
Unquote a string with JavaScript rules. The string has to start with string delimiters (', " or the back-tick/grave accent (for template strings).)
_rules =

Undocumented