MCPcopy Create free account
hub / github.com/ccxt/ccxt / LexerConf

Class LexerConf

python/ccxt/static_dependencies/lark/common.py:27–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25ParserCallbacks = Dict[str, Callable]
26
27class LexerConf(Serialize):
28 __serialize_fields__ = 'terminals', 'ignore', 'g_regex_flags', 'use_bytes', 'lexer_type'
29 __serialize_namespace__ = TerminalDef,
30
31 terminals: Collection[TerminalDef]
32 re_module: ModuleType
33 ignore: Collection[str]
34 postlex: 'Optional[PostLex]'
35 callbacks: Dict[str, _LexerCallback]
36 g_regex_flags: int
37 skip_validation: bool
38 use_bytes: bool
39 lexer_type: Optional[_LexerArgType]
40 strict: bool
41
42 def __init__(self, terminals: Collection[TerminalDef], re_module: ModuleType, ignore: Collection[str]=(), postlex: 'Optional[PostLex]'=None,
43 callbacks: Optional[Dict[str, _LexerCallback]]=None, g_regex_flags: int=0, skip_validation: bool=False, use_bytes: bool=False, strict: bool=False):
44 self.terminals = terminals
45 self.terminals_by_name = {t.name: t for t in self.terminals}
46 assert len(self.terminals) == len(self.terminals_by_name)
47 self.ignore = ignore
48 self.postlex = postlex
49 self.callbacks = callbacks or {}
50 self.g_regex_flags = g_regex_flags
51 self.re_module = re_module
52 self.skip_validation = skip_validation
53 self.use_bytes = use_bytes
54 self.strict = strict
55 self.lexer_type = None
56
57 def _deserialize(self):
58 self.terminals_by_name = {t.name: t for t in self.terminals}
59
60 def __deepcopy__(self, memo=None):
61 return type(self)(
62 deepcopy(self.terminals, memo),
63 self.re_module,
64 deepcopy(self.ignore, memo),
65 deepcopy(self.postlex, memo),
66 deepcopy(self.callbacks, memo),
67 deepcopy(self.g_regex_flags, memo),
68 deepcopy(self.skip_validation, memo),
69 deepcopy(self.use_bytes, memo),
70 )
71
72class ParserConf(Serialize):
73 __serialize_fields__ = 'rules', 'start', 'parser_type'

Callers 2

__init__Method · 0.85
_get_parserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…