Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CST node validation error for match without whitespace #627

Closed
isidentical opened this issue Jan 23, 2022 · 0 comments · Fixed by #628
Closed

CST node validation error for match without whitespace #627

isidentical opened this issue Jan 23, 2022 · 0 comments · Fixed by #628

Comments

@isidentical
Copy link
Contributor

Short reproducer:

match(x):
    case(y):
        pass

Crash:

thread '<unnamed>' panicked at 'conversion failed for Match: PyErr { type: <class 'libcst._nodes.base.CSTValidationError'>, value: CSTValidationError("Must have at least one space after a 'match' keyword"), traceback: Some(<traceback object at 0x7f38d11c7fc0>) }', libcst/src/nodes/statement.rs:2185:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/isidentical/projects/LibCST/libcst/tool.py", line 839, in <module>
    main(os.environ.get("LIBCST_TOOL_COMMAND_NAME", "libcst.tool"), sys.argv[1:])
  File "/home/isidentical/projects/LibCST/libcst/tool.py", line 834, in main
    return lookup.get(args.action or None, _invalid_command)(proc_name, command_args)
  File "/home/isidentical/projects/LibCST/libcst/tool.py", line 278, in _print_tree_impl
    tree = parse_module(
  File "/home/isidentical/projects/LibCST/libcst/_parser/entrypoints.py", line 109, in parse_module
    result = _parse(
  File "/home/isidentical/projects/LibCST/libcst/_parser/entrypoints.py", line 55, in _parse
    return parse(source_str)
pyo3_runtime.PanicException: conversion failed for Match: PyErr { type: <class 'libcst._nodes.base.CSTValidationError'>, value: CSTValidationError("Must have at least one space after a 'match' keyword"), traceback: Some(<traceback object at 0x7f38d11c7fc0>) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant