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

Method parse

python/ccxt/static_dependencies/lark/lark.py:637–655  ·  view source on GitHub ↗

Parse the given text, according to the options provided. Parameters: text (str): Text to be parsed. start (str, optional): Required if Lark was given multiple possible start symbols (using the start option). on_error (function, optional): if provided, wil

(self, text: str, start: Optional[str]=None, on_error: 'Optional[Callable[[UnexpectedInput], bool]]'=None)

Source from the content-addressed store, hash-verified

635 return self.parser.parse_interactive(text, start=start)
636
637 def parse(self, text: str, start: Optional[str]=None, on_error: 'Optional[Callable[[UnexpectedInput], bool]]'=None) -> 'ParseTree':
638 """Parse the given text, according to the options provided.
639
640 Parameters:
641 text (str): Text to be parsed.
642 start (str, optional): Required if Lark was given multiple possible start symbols (using the start option).
643 on_error (function, optional): if provided, will be called on UnexpectedToken error. Return true to resume parsing.
644 LALR only. See examples/advanced/error_handling.py for an example of how to use on_error.
645
646 Returns:
647 If a transformer is supplied to ``__init__``, returns whatever is the
648 result of the transformation. Otherwise, returns a Tree instance.
649
650 :raises UnexpectedInput: On a parse error, one of these sub-exceptions will rise:
651 ``UnexpectedCharacters``, ``UnexpectedToken``, or ``UnexpectedEOF``.
652 For convenience, these sub-exceptions also inherit from ``ParserError`` and ``LexerError``.
653
654 """
655 return self.parser.parse(text, start=start, on_error=on_error)
656
657
658###}

Callers 15

parseFunction · 0.95
parseFunction · 0.95
parseFunction · 0.95
run-tests.jsFile · 0.45
get_regexp_widthFunction · 0.45
_parse_grammarFunction · 0.45
find_grammar_errorsFunction · 0.45
getExchangeSettingsFunction · 0.45
add_static_resultFunction · 0.45
getExchangeSettingsFunction · 0.45
add_static_resultFunction · 0.45
getExchangeSettingsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected