---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/global_stmt_trailing_comma.py
---
## AST
```
Module(
ModModule {
node_index: NodeIndex(None),
range: 0..32,
body: [
Global(
StmtGlobal {
node_index: NodeIndex(None),
range: 0..8,
names: [],
},
),
Global(
StmtGlobal {
node_index: NodeIndex(None),
range: 9..18,
names: [
Identifier {
id: Name("x"),
range: 16..17,
node_index: NodeIndex(None),
},
],
},
),
Global(
StmtGlobal {
node_index: NodeIndex(None),
range: 19..31,
names: [
Identifier {
id: Name("x"),
range: 26..27,
node_index: NodeIndex(None),
},
Identifier {
id: Name("y"),
range: 29..30,
node_index: NodeIndex(None),
},
],
},
),
],
runtime_body: None,
},
)
```
## Errors
|
1 | global ,
| ^ Syntax Error: invalid syntax
2 | global x,
3 | global x, y,
|
|
1 | global ,
| ^ Syntax Error: global statement must have at least one name
2 | global x,
3 | global x, y,
|
|
1 | global ,
2 | global x,
| ^ Syntax Error: trailing comma not allowed without surrounding parentheses
3 | global x, y,
|
|
1 | global ,
2 | global x,
3 | global x, y,
| ^ Syntax Error: trailing comma not allowed without surrounding parentheses