ruff/crates/ruff_python_parser/src
Abhijeet Prasad Bodas cf59cee928
[syntax-errors] nonlocal declaration at module level (#17559)
## Summary

Part of #17412

Add a new compile-time syntax error for detecting `nonlocal`
declarations at a module level.

## Test Plan

- Added new inline tests for the syntax error
- Updated existing tests for `nonlocal` statement parsing to be inside a
function scope

Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2025-04-24 16:11:46 -04:00
..
lexer Mention that Cursor is based on rustc's implementation. (#12109) 2024-06-30 16:53:25 +01:00
parser [syntax-errors] nonlocal declaration at module level (#17559) 2025-04-24 16:11:46 -04:00
snapshots Raise syntax error when \ is at end of file (#17409) 2025-04-15 21:26:12 +05:30
error.rs [syntax-errors] Make duplicate parameter names a semantic error (#17131) 2025-04-23 15:45:51 -04:00
lexer.rs Raise syntax error when \ is at end of file (#17409) 2025-04-15 21:26:12 +05:30
lib.rs [red-knot] Add basic on-hover to playground and LSP (#17057) 2025-04-04 08:13:43 +02:00
semantic_errors.rs [syntax-errors] nonlocal declaration at module level (#17559) 2025-04-24 16:11:46 -04:00
string.rs Upgrade to Rust 1.81 (#13265) 2024-09-06 15:09:09 +02:00
token.rs [syntax-errors] PEP 701 f-strings before Python 3.12 (#16543) 2025-03-18 11:12:15 -04:00
token_set.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
token_source.rs [syntax-errors] PEP 701 f-strings before Python 3.12 (#16543) 2025-03-18 11:12:15 -04:00
typing.rs Rename ExprStringLiteral::as_unconcatenated_string() to ExprStringLiteral::as_single_part_string() (#16253) 2025-02-19 16:06:57 +00:00