LibCST/native
Steven Troxler b5c34d39a0
Fix Github issue 855 - fail to parse with statement (#861)
* Fix Github issue 855 - fail to parse with statement

When we added support for parenthesized with statements, the
grammar on the with itself was correct (it's a right and left
parenthesis around a comma-separated list of with-items, with
a possible trailing comma).

But inside of the "as" variation of the with_item rule we have a peek at
the next character, which was allowing for a comma or a colon. That peek
needs to also accept right parentheses - otherwise, if the last item
contains an `as` and has no trailing comma we fail to parse.

The bug is exercisecd by, for example, this code snippet:
```
with (foo, bar as bar,):
    pass
```

The with_wickedness test fixture has been revised to include both
the plain and async variations of this example snippet with and without
trailing comma, and tests pass after the peek rule fix.

* Add more tests covering the plain expression form of `with_item`
2023-02-16 10:49:05 -08:00
..
libcst Fix Github issue 855 - fail to parse with statement (#861) 2023-02-16 10:49:05 -08:00
libcst_derive parser: use references instead of smart pointers for Tokens (#691) 2022-06-07 04:08:37 -06:00
Cargo.lock Bump pyo3 from 0.17.2 to 0.17.3 in /native (#805) 2022-11-08 10:46:35 +00:00
Cargo.toml Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
roundtrip.sh fix copyright headers and add a script to check (#635) 2022-02-01 11:13:17 +00:00