Skip to content

Commit b07d6ff

Browse files
authored
Merge pull request #1196 from bcr/whitespace-fixes
Remove trailing whitespace
2 parents f009312 + 1a86228 commit b07d6ff

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lark/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_context(self, text: str, span: int=40) -> str:
7272
after = text[pos:end].split(b'\n', 1)[0]
7373
return (before + after + b'\n' + b' ' * len(before.expandtabs()) + b'^\n').decode("ascii", "backslashreplace")
7474

75-
def match_examples(self, parse_fn: 'Callable[[str], Tree]',
75+
def match_examples(self, parse_fn: 'Callable[[str], Tree]',
7676
examples: Union[Mapping[T, Iterable[str]], Iterable[Tuple[T, Iterable[str]]]],
7777
token_type_match_fallback: bool=False,
7878
use_accepts: bool=True
@@ -229,7 +229,7 @@ class UnexpectedToken(ParseError, UnexpectedInput):
229229

230230
def __init__(self, token, expected, considered_rules=None, state=None, interactive_parser=None, terminals_by_name=None, token_history=None):
231231
super(UnexpectedToken, self).__init__()
232-
232+
233233
# TODO considered_rules and expected can be figured out using state
234234
self.line = getattr(token, 'line', '?')
235235
self.column = getattr(token, 'column', '?')

lark/lark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def __init__(self, grammar: 'Union[Grammar, str, IO[str]]', **options) -> None:
310310
else:
311311
if self.options.cache is not True:
312312
raise ConfigurationError("cache argument must be bool or str")
313-
313+
314314
try:
315315
username = getpass.getuser()
316316
except Exception:
@@ -339,7 +339,7 @@ def __init__(self, grammar: 'Union[Grammar, str, IO[str]]', **options) -> None:
339339
pass
340340
except Exception: # We should probably narrow done which errors we catch here.
341341
logger.exception("Failed to load Lark from cache: %r. We will try to carry on.", cache_fn)
342-
342+
343343
# In theory, the Lark instance might have been messed up by the call to `_load`.
344344
# In practice the only relevant thing that might have been overwritten should be `options`
345345
self.options = old_options
@@ -609,7 +609,7 @@ def lex(self, text: str, dont_ignore: bool=False) -> Iterator[Token]:
609609
def get_terminal(self, name: str) -> TerminalDef:
610610
"""Get information about a terminal"""
611611
return self._terminals_dict[name]
612-
612+
613613
def parse_interactive(self, text: Optional[str]=None, start: Optional[str]=None) -> 'InteractiveParser':
614614
"""Start an interactive parsing session.
615615

lark/parser_frontends.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, lexer_conf, parser_conf, options, parser=None):
7474

7575
if lexer_conf.postlex:
7676
self.lexer = PostLexConnector(self.lexer, lexer_conf.postlex)
77-
77+
7878
def _verify_start(self, start=None):
7979
if start is None:
8080
start_decls = self.parser_conf.start
@@ -94,7 +94,7 @@ def parse(self, text, start=None, on_error=None):
9494
kw = {} if on_error is None else {'on_error': on_error}
9595
stream = self._make_lexer_thread(text)
9696
return self.parser.parse(stream, chosen_start, **kw)
97-
97+
9898
def parse_interactive(self, text=None, start=None):
9999
chosen_start = self._verify_start(start)
100100
if self.parser_conf.parser_type != 'lalr':

0 commit comments

Comments
 (0)