@@ -10,8 +10,8 @@ DEC_NUMBER: /0|[1-9][\d_]*/i | |||||
HEX_NUMBER.2: /0x[\da-f]*/i | HEX_NUMBER.2: /0x[\da-f]*/i | ||||
OCT_NUMBER.2: /0o[0-7]*/i | OCT_NUMBER.2: /0o[0-7]*/i | ||||
BIN_NUMBER.2 : /0b[0-1]*/i | BIN_NUMBER.2 : /0b[0-1]*/i | ||||
FLOAT_NUMBER.2: /((\d+\.[\d_]*|\.[\d_]+)(e[-+]?\d+)?|\d+(e[-+]?\d+))/i | |||||
IMAG_NUMBER.2: /\d+j/i | FLOAT_NUMBER "j"i | |||||
FLOAT_NUMBER.2: /((\d+\.[\d_]*|\.[\d_]+)([Ee][-+]?\d+)?|\d+([Ee][-+]?\d+))/ | |||||
IMAG_NUMBER.2: /\d+[Jj]/ | FLOAT_NUMBER /[Jj]/ | |||||
// Comma-separated list (with an optional trailing comma) | // Comma-separated list (with an optional trailing comma) | ||||
@@ -9,6 +9,10 @@ class DedentError(LarkError): | |||||
pass | pass | ||||
class Indenter(PostLex): | class Indenter(PostLex): | ||||
OPEN_PAREN_types: list | |||||
CLOSE_PAREN_types: list | |||||
DEDENT_type: str | |||||
def __init__(self): | def __init__(self): | ||||
self.paren_level = None | self.paren_level = None | ||||
self.indent_level = None | self.indent_level = None | ||||
@@ -151,7 +151,7 @@ def _should_expand(sym): | |||||
return not sym.is_term and sym.name.startswith('_') | return not sym.is_term and sym.name.startswith('_') | ||||
def maybe_create_child_filter(expansion, keep_all_tokens, ambiguous, _empty_indices): | |||||
def maybe_create_child_filter(expansion, keep_all_tokens, ambiguous, _empty_indices: list): | |||||
# Prepare empty_indices as: How many Nones to insert at each index? | # Prepare empty_indices as: How many Nones to insert at each index? | ||||
if _empty_indices: | if _empty_indices: | ||||
assert _empty_indices.count(False) == len(expansion) | assert _empty_indices.count(False) == len(expansion) | ||||