Skip to content

Commit 43e6ea8

Browse files
remove assignments
1 parent 1827f10 commit 43e6ea8

13 files changed

+1547
-28
lines changed

crates/djls-template-ast/SPEC.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ pub enum Block {
114114
tag: Tag,
115115
nodes: Vec<Node>,
116116
closing: Option<Box<Block>>,
117-
assignments: Option<Vec<Assignment>>,
118117
},
119118
Branch {
120119
tag: Tag,
@@ -169,7 +168,6 @@ Block::Block {
169168
tag: Tag, // The opening Tag of the block
170169
nodes: Vec<Node>, // Nodes contained within the block
171170
closing: Option<Box<Block>>, // Contains Block::Closing if present
172-
assignments: Option<Vec<Assignment>>, // Assignments declared within the tag
173171
}
174172
```
175173

crates/djls-template-ast/src/ast.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ pub enum Block {
149149
tag: Tag,
150150
nodes: Vec<Node>,
151151
closing: Option<Box<Block>>,
152-
assignments: Option<Vec<Assignment>>,
153152
},
154153
Branch {
155154
tag: Tag,
@@ -193,13 +192,6 @@ impl Block {
193192
}
194193
}
195194

196-
pub fn assignments(&self) -> Option<&Vec<Assignment>> {
197-
match self {
198-
Block::Block { assignments, .. } => assignments.as_ref(),
199-
_ => None,
200-
}
201-
}
202-
203195
pub fn template_name(&self) -> Option<&String> {
204196
match self {
205197
Block::Inclusion { template_name, .. } => Some(template_name),
@@ -324,7 +316,6 @@ mod tests {
324316
},
325317
nodes: vec![],
326318
closing: None,
327-
assignments: None,
328319
})];
329320

330321
let ast = Ast {

crates/djls-template-ast/src/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ impl Parser {
153153
tag,
154154
nodes,
155155
closing,
156-
assignments: None,
157156
}))
158157
}
159158

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,5 @@ nodes:
7979
start: 63
8080
length: 5
8181
assignment: ~
82-
assignments: ~
8382
line_offsets:
8483
- 0

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@ nodes:
5959
start: 55
6060
length: 6
6161
assignment: ~
62-
assignments: ~
6362
line_offsets:
6463
- 0

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@ nodes:
3636
start: 40
3737
length: 5
3838
assignment: ~
39-
assignments: ~
4039
line_offsets:
4140
- 0

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ nodes:
9292
start: 151
9393
length: 5
9494
assignment: ~
95-
assignments: ~
9695
- Variable:
9796
bits:
9897
- group
@@ -135,7 +134,6 @@ nodes:
135134
start: 223
136135
length: 5
137136
assignment: ~
138-
assignments: ~
139137
- Block:
140138
Block:
141139
tag:
@@ -169,7 +167,6 @@ nodes:
169167
start: 265
170168
length: 5
171169
assignment: ~
172-
assignments: ~
173170
- Block:
174171
Branch:
175172
tag:
@@ -202,7 +199,6 @@ nodes:
202199
start: 317
203200
length: 6
204201
assignment: ~
205-
assignments: ~
206202
- Block:
207203
Branch:
208204
tag:
@@ -235,7 +231,6 @@ nodes:
235231
start: 351
236232
length: 5
237233
assignment: ~
238-
assignments: ~
239234
- Text:
240235
content: "!"
241236
span:

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ nodes:
5656
start: 61
5757
length: 5
5858
assignment: ~
59-
assignments: ~
6059
closing:
6160
Closing:
6261
tag:
@@ -70,6 +69,5 @@ nodes:
7069
start: 72
7170
length: 6
7271
assignment: ~
73-
assignments: ~
7472
line_offsets:
7573
- 0

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ nodes:
108108
start: 323
109109
length: 6
110110
assignment: ~
111-
assignments: ~
112111
- Text:
113112
content: "<footer>Page Footer</footer>"
114113
span:
@@ -120,7 +119,6 @@ nodes:
120119
start: 366
121120
length: 6
122121
closing: ~
123-
assignments: ~
124122
line_offsets:
125123
- 0
126124
- 24

crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ nodes:
2929
start: 26
3030
length: 9
3131
closing: ~
32-
assignments: ~
3332
line_offsets:
3433
- 0

0 commit comments

Comments
 (0)