1use crate::kind::PythonSyntaxKind;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct SourceFile {
6 pub statements: Vec<Element>,
7}
8
9#[derive(Debug, Clone, PartialEq, Eq)]
11pub enum Element {
12 FunctionDef { name: String, args: Vec<String>, body: Vec<Element> },
14 ClassDef { name: String, bases: Vec<String>, body: Vec<Element> },
16 Assign { target: String, value: String },
18 Expr { value: String },
20 Import { module: String, alias: Option<String> },
22 ImportFrom { module: String, names: Vec<String> },
24 Return { value: Option<String> },
26 If { test: String, body: Vec<Element>, orelse: Vec<Element> },
28 For { target: String, iter: String, body: Vec<Element> },
30 While { test: String, body: Vec<Element> },
32 Comment { text: String },
34 Other { kind: PythonSyntaxKind, text: String },
36}