Skip to content

Commit fab360b

Browse files
updates
1 parent c57ff43 commit fab360b

21 files changed

+125
-22
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ impl Parser {
2020

2121
// First pass: collect line offsets
2222
for token in self.tokens.tokens() {
23-
if token.line() > last_line {
23+
if *token.line() > last_line {
2424
if let Some(start) = token.start() {
2525
line_offsets.add_line(*start as u32);
2626
}
27-
last_line = token.line();
27+
last_line = *token.line();
2828
}
2929
}
3030

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ nodes:
1313
span:
1414
start: 21
1515
length: 18
16-
line_offsets: []
16+
line_offsets:
17+
- 0
18+
- 0
1719
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,7 @@ nodes:
6969
tag_span:
7070
start: 0
7171
length: 8
72-
line_offsets: []
72+
line_offsets:
73+
- 0
74+
- 0
7375
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ nodes:
5252
tag_span:
5353
start: 0
5454
length: 17
55-
line_offsets: []
55+
line_offsets:
56+
- 0
57+
- 0
5658
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ nodes:
3232
tag_span:
3333
start: 0
3434
length: 24
35-
line_offsets: []
35+
line_offsets:
36+
- 0
37+
- 0
3638
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ nodes:
1616
span:
1717
start: 0
1818
length: 15
19-
line_offsets: []
19+
line_offsets:
20+
- 0
21+
- 0
2022
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ nodes:
2626
span:
2727
start: 0
2828
length: 35
29-
line_offsets: []
29+
line_offsets:
30+
- 0
31+
- 0
3032
errors: []

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,19 @@ nodes:
250250
span:
251251
start: 359
252252
length: 1
253-
line_offsets: []
253+
line_offsets:
254+
- 0
255+
- 0
256+
- 39
257+
- 81
258+
- 116
259+
- 159
260+
- 184
261+
- 231
262+
- 273
263+
- 289
264+
- 309
265+
- 326
266+
- 337
267+
- 347
254268
errors: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@ nodes:
6161
tag_span:
6262
start: 0
6363
length: 17
64-
line_offsets: []
64+
line_offsets:
65+
- 0
66+
- 0
6567
errors: []

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ nodes:
107107
tag_span:
108108
start: 48
109109
length: 24
110-
line_offsets: []
110+
line_offsets:
111+
- 0
112+
- 0
113+
- 23
114+
- 43
115+
- 78
116+
- 130
117+
- 169
118+
- 183
119+
- 243
120+
- 275
121+
- 311
122+
- 332
123+
- 365
111124
errors:
112125
- UnclosedTag: if

0 commit comments

Comments
 (0)