Skip to content

Parsing errors when using match statement #9

Description

@salotz
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/libcst/_parser/base_parser.py", line 151, in _add_token
INTERNALERROR>     plan = stack[-1].dfa.transitions[transition]
INTERNALERROR>            ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
INTERNALERROR> KeyError: TokenType(NAME)
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/_pytest/main.py", line 268, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/_pytest/main.py", line 322, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/pluggy/_callers.py", line 155, in _multicall
INTERNALERROR>     teardown[0].send(outcome)
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/pytest_pointers/plugin.py", line 153, in pytest_runtestloop
INTERNALERROR>     for func in funcs:
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/pytest_pointers/utils.py", line 74, in __iter__
INTERNALERROR>     tree = cst.parse_module(f.read())
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/libcst/_parser/entrypoints.py", line 70, in parse_module
INTERNALERROR>     result = _parse(
INTERNALERROR>              ^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/libcst/_parser/entrypoints.py", line 50, in _parse
INTERNALERROR>     result = parser.parse()
INTERNALERROR>              ^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/libcst/_parser/base_parser.py", line 110, in parse
INTERNALERROR>     self._add_token(token)
INTERNALERROR>   File "/home/salotz/tree/ibeks/devel/bos/.nox/test_unit/lib/python3.11/site-packages/libcst/_parser/base_parser.py", line 186, in _add_token
INTERNALERROR>     raise ParserSyntaxError(
INTERNALERROR> libcst._exceptions.ParserSyntaxError: Syntax Error @ 37:15.
INTERNALERROR> Incomplete input. Encountered 'json_loads', but expected ';', or 'NEWLINE'.
INTERNALERROR> 
INTERNALERROR>         match json_loads(data, **kwargs):
INTERNALERROR>        

Getting a parse error from libcst when using the match statement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions