MCPcopy Create free account
hub / github.com/nodejs/node / ParserSyntaxError

Class ParserSyntaxError

tools/gyp/pylib/packaging/_tokenizer.py:16–34  ·  view source on GitHub ↗

The provided source text could not be parsed correctly.

Source from the content-addressed store, hash-verified

14
15
16class ParserSyntaxError(Exception):
17 """The provided source text could not be parsed correctly."""
18
19 def __init__(
20 self,
21 message: str,
22 *,
23 source: str,
24 span: Tuple[int, int],
25 ) -> None:
26 self.span = span
27 self.message = message
28 self.source = source
29
30 super().__init__()
31
32 def __str__(self) -> str:
33 marker = " " * self.span[0] + "~" * (self.span[1] - self.span[0]) + "^"
34 return "\n ".join([self.message, self.source, marker])
35
36
37DEFAULT_RULES: "Dict[str, Union[str, re.Pattern[str]]]" = {

Callers 1

raise_syntax_errorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected