diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap index d9e7e4c..34109ef 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap @@ -3,6 +3,15 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "" - - Comment: Django comment + - Text: + content: "" + span: + start: 0 + length: 21 + - Comment: + content: Django comment + span: + start: 21 + length: 18 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap.new deleted file mode 100644 index 7d9b0a8..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__comments__parse_comments.snap.new +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 605 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "" - span: - start: 0 - length: 21 - - Comment: - content: Django comment - span: - start: 21 - length: 18 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap index 5bb029f..11d6556 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap @@ -12,7 +12,11 @@ nodes: - ">" - "0" children: - - Text: Positive + - Text: + content: Positive + span: + start: 14 + length: 8 - Block: block_type: Branch name: elif @@ -21,16 +25,49 @@ nodes: - "<" - "0" children: - - Text: Negative + - Text: + content: Negative + span: + start: 38 + length: 8 + span: + start: 0 + length: 8 + tag_span: + start: 0 + length: 8 - Block: block_type: Branch name: else bits: [] children: - - Text: Zero + - Text: + content: Zero + span: + start: 56 + length: 4 + span: + start: 0 + length: 8 + tag_span: + start: 0 + length: 8 - Block: block_type: Closing name: endif bits: [] children: ~ + span: + start: 60 + length: 5 + tag_span: + start: 0 + length: 8 + span: + start: 0 + length: 65 + tag_span: + start: 0 + length: 8 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap.new deleted file mode 100644 index 571b55e..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_complex_if_elif.snap.new +++ /dev/null @@ -1,75 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 524 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: if - bits: - - if - - x - - ">" - - "0" - children: - - Text: - content: Positive - span: - start: 14 - length: 8 - - Block: - block_type: Branch - name: elif - bits: - - x - - "<" - - "0" - children: - - Text: - content: Negative - span: - start: 38 - length: 8 - span: - start: 0 - length: 8 - tag_span: - start: 0 - length: 8 - - Block: - block_type: Branch - name: else - bits: [] - children: - - Text: - content: Zero - span: - start: 56 - length: 4 - span: - start: 0 - length: 8 - tag_span: - start: 0 - length: 8 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 60 - length: 5 - tag_span: - start: 0 - length: 8 - span: - start: 0 - length: 65 - tag_span: - start: 0 - length: 8 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap index bacec67..479f215 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap @@ -16,15 +16,41 @@ nodes: bits: - item filters: [] + span: + start: 23 + length: 4 - Block: block_type: Branch name: empty bits: [] children: - - Text: No items + - Text: + content: No items + span: + start: 44 + length: 8 + span: + start: 0 + length: 17 + tag_span: + start: 0 + length: 17 - Block: block_type: Closing name: endfor bits: [] children: ~ + span: + start: 52 + length: 6 + tag_span: + start: 0 + length: 17 + span: + start: 0 + length: 58 + tag_span: + start: 0 + length: 17 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap.new deleted file mode 100644 index 56c0eee..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_for_block.snap.new +++ /dev/null @@ -1,58 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 515 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: for - bits: - - for - - item - - in - - items - children: - - Variable: - bits: - - item - filters: [] - span: - start: 23 - length: 4 - - Block: - block_type: Branch - name: empty - bits: [] - children: - - Text: - content: No items - span: - start: 44 - length: 8 - span: - start: 0 - length: 17 - tag_span: - start: 0 - length: 17 - - Block: - block_type: Closing - name: endfor - bits: [] - children: ~ - span: - start: 52 - length: 6 - tag_span: - start: 0 - length: 17 - span: - start: 0 - length: 58 - tag_span: - start: 0 - length: 17 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap index 9f663bd..3e60bd1 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap @@ -10,10 +10,27 @@ nodes: - if - user.is_authenticated children: - - Text: Welcome + - Text: + content: Welcome + span: + start: 30 + length: 7 - Block: block_type: Closing name: endif bits: [] children: ~ + span: + start: 37 + length: 5 + tag_span: + start: 0 + length: 24 + span: + start: 0 + length: 42 + tag_span: + start: 0 + length: 24 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap.new deleted file mode 100644 index 8b4e5b9..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_if_block.snap.new +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 506 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_authenticated - children: - - Text: - content: Welcome - span: - start: 30 - length: 7 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 37 - length: 5 - tag_span: - start: 0 - length: 24 - span: - start: 0 - length: 42 - tag_span: - start: 0 - length: 24 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap index e51a045..2662026 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap @@ -10,4 +10,11 @@ nodes: filters: - name: title arguments: [] + span: + start: 10 + length: 5 + span: + start: 0 + length: 15 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap.new deleted file mode 100644 index a29fc77..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_django_variable.snap.new +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 488 -expression: ast -snapshot_kind: text ---- -nodes: - - Variable: - bits: - - user - - name - filters: - - name: title - arguments: [] - span: - start: 10 - length: 5 - span: - start: 0 - length: 15 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap index abae67b..86f6776 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap @@ -10,8 +10,21 @@ nodes: - name: default arguments: - "'nothing'" + span: + start: 6 + length: 17 - name: title arguments: [] + span: + start: 24 + length: 5 - name: upper arguments: [] + span: + start: 30 + length: 5 + span: + start: 0 + length: 35 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap.new deleted file mode 100644 index c49ec1f..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_filter_chains.snap.new +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 497 -expression: ast -snapshot_kind: text ---- -nodes: - - Variable: - bits: - - value - filters: - - name: default - arguments: - - "'nothing'" - span: - start: 6 - length: 17 - - name: title - arguments: [] - span: - start: 24 - length: 5 - - name: upper - arguments: [] - span: - start: 30 - length: 5 - span: - start: 0 - length: 35 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap index c728b26..18ceec3 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap @@ -3,7 +3,11 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "Welcome, " + - Text: + content: "Welcome, " + span: + start: 0 + length: 9 - Block: block_type: Standard name: if @@ -11,7 +15,11 @@ nodes: - if - user.is_authenticated children: - - Text: "\n " + - Text: + content: "\n " + span: + start: 39 + length: 5 - Variable: bits: - user @@ -19,10 +27,23 @@ nodes: filters: - name: title arguments: [] + span: + start: 54 + length: 5 - name: default arguments: - "'Guest'" - - Text: "\n " + span: + start: 60 + length: 15 + span: + start: 44 + length: 31 + - Text: + content: "\n " + span: + start: 81 + length: 5 - Block: block_type: Standard name: for @@ -32,7 +53,11 @@ nodes: - in - user.groups children: - - Text: "\n " + - Text: + content: "\n " + span: + start: 116 + length: 9 - Block: block_type: Standard name: if @@ -40,19 +65,46 @@ nodes: - if - forloop.first children: - - Text: ( + - Text: + content: ( + span: + start: 147 + length: 1 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "\n " + span: + start: 148 + length: 5 + tag_span: + start: 125 + length: 16 + span: + start: 125 + length: 28 + tag_span: + start: 125 + length: 16 + - Text: + content: "\n " + span: + start: 159 + length: 9 - Variable: bits: - group - name filters: [] - - Text: "\n " + span: + start: 168 + length: 10 + - Text: + content: "\n " + span: + start: 184 + length: 9 - Block: block_type: Standard name: if @@ -61,13 +113,33 @@ nodes: - not - forloop.last children: - - Text: ", " + - Text: + content: ", " + span: + start: 218 + length: 2 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "\n " + span: + start: 220 + length: 5 + tag_span: + start: 193 + length: 19 + span: + start: 193 + length: 32 + tag_span: + start: 193 + length: 19 + - Text: + content: "\n " + span: + start: 231 + length: 9 - Block: block_type: Standard name: if @@ -75,35 +147,108 @@ nodes: - if - forloop.last children: - - Text: ) + - Text: + content: ) + span: + start: 261 + length: 1 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "\n " + span: + start: 262 + length: 5 + tag_span: + start: 240 + length: 15 + span: + start: 240 + length: 27 + tag_span: + start: 240 + length: 15 + - Text: + content: "\n " + span: + start: 273 + length: 5 - Block: block_type: Branch name: empty bits: [] children: - - Text: "\n (no groups)\n " + - Text: + content: "\n (no groups)\n " + span: + start: 289 + length: 25 + span: + start: 86 + length: 24 + tag_span: + start: 86 + length: 24 - Block: block_type: Closing name: endfor bits: [] children: ~ - - Text: "\n" + span: + start: 314 + length: 6 + tag_span: + start: 86 + length: 24 + span: + start: 86 + length: 234 + tag_span: + start: 86 + length: 24 + - Text: + content: "\n" + span: + start: 326 + length: 1 - Block: block_type: Branch name: else bits: [] children: - - Text: "\n Guest\n" + - Text: + content: "\n Guest\n" + span: + start: 337 + length: 11 + span: + start: 9 + length: 24 + tag_span: + start: 9 + length: 24 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "!" + span: + start: 348 + length: 5 + tag_span: + start: 9 + length: 24 + span: + start: 9 + length: 344 + tag_span: + start: 9 + length: 24 + - Text: + content: "!" + span: + start: 359 + length: 1 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap.new deleted file mode 100644 index 709af53..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_mixed_content.snap.new +++ /dev/null @@ -1,256 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 555 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "Welcome, " - span: - start: 0 - length: 9 - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_authenticated - children: - - Text: - content: "\n " - span: - start: 39 - length: 5 - - Variable: - bits: - - user - - name - filters: - - name: title - arguments: [] - span: - start: 54 - length: 5 - - name: default - arguments: - - "'Guest'" - span: - start: 60 - length: 15 - span: - start: 44 - length: 31 - - Text: - content: "\n " - span: - start: 81 - length: 5 - - Block: - block_type: Standard - name: for - bits: - - for - - group - - in - - user.groups - children: - - Text: - content: "\n " - span: - start: 116 - length: 9 - - Block: - block_type: Standard - name: if - bits: - - if - - forloop.first - children: - - Text: - content: ( - span: - start: 147 - length: 1 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 148 - length: 5 - tag_span: - start: 125 - length: 16 - span: - start: 125 - length: 28 - tag_span: - start: 125 - length: 16 - - Text: - content: "\n " - span: - start: 159 - length: 9 - - Variable: - bits: - - group - - name - filters: [] - span: - start: 168 - length: 10 - - Text: - content: "\n " - span: - start: 184 - length: 9 - - Block: - block_type: Standard - name: if - bits: - - if - - not - - forloop.last - children: - - Text: - content: ", " - span: - start: 218 - length: 2 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 220 - length: 5 - tag_span: - start: 193 - length: 19 - span: - start: 193 - length: 32 - tag_span: - start: 193 - length: 19 - - Text: - content: "\n " - span: - start: 231 - length: 9 - - Block: - block_type: Standard - name: if - bits: - - if - - forloop.last - children: - - Text: - content: ) - span: - start: 261 - length: 1 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 262 - length: 5 - tag_span: - start: 240 - length: 15 - span: - start: 240 - length: 27 - tag_span: - start: 240 - length: 15 - - Text: - content: "\n " - span: - start: 273 - length: 5 - - Block: - block_type: Branch - name: empty - bits: [] - children: - - Text: - content: "\n (no groups)\n " - span: - start: 289 - length: 25 - span: - start: 86 - length: 24 - tag_span: - start: 86 - length: 24 - - Block: - block_type: Closing - name: endfor - bits: [] - children: ~ - span: - start: 314 - length: 6 - tag_span: - start: 86 - length: 24 - span: - start: 86 - length: 234 - tag_span: - start: 86 - length: 24 - - Text: - content: "\n" - span: - start: 326 - length: 1 - - Block: - block_type: Branch - name: else - bits: [] - children: - - Text: - content: "\n Guest\n" - span: - start: 337 - length: 11 - span: - start: 9 - length: 24 - tag_span: - start: 9 - length: 24 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 348 - length: 5 - tag_span: - start: 9 - length: 24 - span: - start: 9 - length: 344 - tag_span: - start: 9 - length: 24 - - Text: - content: "!" - span: - start: 359 - length: 1 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap index 8f920db..3542f4f 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap @@ -24,14 +24,42 @@ nodes: - item - name filters: [] + span: + start: 43 + length: 9 - Block: block_type: Closing name: endif bits: [] children: ~ + span: + start: 58 + length: 5 + tag_span: + start: 23 + length: 14 + span: + start: 23 + length: 40 + tag_span: + start: 23 + length: 14 - Block: block_type: Closing name: endfor bits: [] children: ~ + span: + start: 69 + length: 6 + tag_span: + start: 0 + length: 17 + span: + start: 0 + length: 75 + tag_span: + start: 0 + length: 17 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap.new deleted file mode 100644 index 4292555..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__django__parse_nested_for_if.snap.new +++ /dev/null @@ -1,67 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 534 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: for - bits: - - for - - item - - in - - items - children: - - Block: - block_type: Standard - name: if - bits: - - if - - item.active - children: - - Variable: - bits: - - item - - name - filters: [] - span: - start: 43 - length: 9 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 58 - length: 5 - tag_span: - start: 23 - length: 14 - span: - start: 23 - length: 40 - tag_span: - start: 23 - length: 14 - - Block: - block_type: Closing - name: endfor - bits: [] - children: ~ - span: - start: 69 - length: 6 - tag_span: - start: 0 - length: 17 - span: - start: 0 - length: 75 - tag_span: - start: 0 - length: 17 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap index 7b7b1a3..720f40d 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap @@ -3,7 +3,11 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "
\n

Header

\n " + - Text: + content: "
\n

Header

\n " + span: + start: 0 + length: 48 - Block: block_type: Standard name: if @@ -11,17 +15,44 @@ nodes: - if - user.is_authenticated children: - - Text: "\n " - - Comment: This if is unclosed which does matter - - Text: "\n

Welcome " + - Text: + content: "\n " + span: + start: 78 + length: 9 + - Comment: + content: This if is unclosed which does matter + span: + start: 87 + length: 41 + - Text: + content: "\n

Welcome " + span: + start: 130 + length: 20 - Variable: bits: - user - name filters: [] - - Text: "

\n
\n " - - Comment: "This div is unclosed which doesn't matter" - - Text: "\n " + span: + start: 150 + length: 9 + - Text: + content: "

\n
\n " + span: + start: 165 + length: 31 + - Comment: + content: "This div is unclosed which doesn't matter" + span: + start: 196 + length: 45 + - Text: + content: "\n " + span: + start: 243 + length: 9 - Block: block_type: Standard name: for @@ -31,17 +62,51 @@ nodes: - in - items children: - - Text: "\n " + - Text: + content: "\n " + span: + start: 275 + length: 19 - Variable: bits: - item filters: [] - - Text: "\n " + span: + start: 294 + length: 4 + - Text: + content: "\n " + span: + start: 304 + length: 16 - Block: block_type: Closing name: endfor bits: [] children: ~ - - Text: "\n
Page Footer
\n
" + span: + start: 320 + length: 6 + tag_span: + start: 252 + length: 17 + span: + start: 252 + length: 74 + tag_span: + start: 252 + length: 17 + - Text: + content: "\n
Page Footer
\n
" + span: + start: 332 + length: 40 + span: + start: 48 + length: 24 + tag_span: + start: 48 + length: 24 +line_offsets: [] errors: - UnclosedTag: if diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap.new deleted file mode 100644 index fd4780e..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_error_recovery.snap.new +++ /dev/null @@ -1,114 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 681 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "
\n

Header

\n " - span: - start: 0 - length: 48 - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_authenticated - children: - - Text: - content: "\n " - span: - start: 78 - length: 9 - - Comment: - content: This if is unclosed which does matter - span: - start: 87 - length: 41 - - Text: - content: "\n

Welcome " - span: - start: 130 - length: 20 - - Variable: - bits: - - user - - name - filters: [] - span: - start: 150 - length: 9 - - Text: - content: "

\n
\n " - span: - start: 165 - length: 31 - - Comment: - content: "This div is unclosed which doesn't matter" - span: - start: 196 - length: 45 - - Text: - content: "\n " - span: - start: 243 - length: 9 - - Block: - block_type: Standard - name: for - bits: - - for - - item - - in - - items - children: - - Text: - content: "\n " - span: - start: 275 - length: 19 - - Variable: - bits: - - item - filters: [] - span: - start: 294 - length: 4 - - Text: - content: "\n " - span: - start: 304 - length: 16 - - Block: - block_type: Closing - name: endfor - bits: [] - children: ~ - span: - start: 320 - length: 6 - tag_span: - start: 252 - length: 17 - span: - start: 252 - length: 74 - tag_span: - start: 252 - length: 17 - - Text: - content: "\n
Page Footer
\n
" - span: - start: 332 - length: 40 - span: - start: 48 - length: 24 - tag_span: - start: 48 - length: 24 -line_offsets: [] -errors: - - UnclosedTag: if diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap index 20e02f8..12303b2 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap @@ -17,5 +17,15 @@ nodes: - item - name filters: [] + span: + start: 23 + length: 9 + span: + start: 0 + length: 17 + tag_span: + start: 0 + length: 17 +line_offsets: [] errors: - UnclosedTag: for diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap.new deleted file mode 100644 index 46fee1d..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_for.snap.new +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 639 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: for - bits: - - for - - item - - in - - items - children: - - Variable: - bits: - - item - - name - filters: [] - span: - start: 23 - length: 9 - span: - start: 0 - length: 17 - tag_span: - start: 0 - length: 17 -line_offsets: [] -errors: - - UnclosedTag: for diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap index 01bfcfe..62e48e3 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap @@ -10,6 +10,17 @@ nodes: - if - user.is_authenticated children: - - Text: Welcome + - Text: + content: Welcome + span: + start: 30 + length: 7 + span: + start: 0 + length: 24 + tag_span: + start: 0 + length: 24 +line_offsets: [] errors: - UnclosedTag: if diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap.new deleted file mode 100644 index c45d407..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_django_if.snap.new +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 628 -expression: ast -snapshot_kind: text ---- -nodes: - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_authenticated - children: - - Text: - content: Welcome - span: - start: 30 - length: 7 - span: - start: 0 - length: 24 - tag_span: - start: 0 - length: 24 -line_offsets: [] -errors: - - UnclosedTag: if diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap index cba380d..be8aa85 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "
" + - Text: + content: "
" + span: + start: 0 + length: 5 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap.new deleted file mode 100644 index 647a075..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_html_tag.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 618 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "
" - span: - start: 0 - length: 5 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_script.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_script.snap index 570968a..5d21c55 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_script.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__errors__parse_unclosed_script.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "\n \n \n \n
\n " + - Text: + content: "\n\n \n \n \n \n \n \n
\n " + span: + start: 0 + length: 463 - Block: block_type: Standard name: if @@ -11,9 +15,21 @@ nodes: - if - user.is_authenticated children: - - Text: "\n " - - Comment: Welcome message - - Text: "\n

Welcome, " + - Text: + content: "\n " + span: + start: 493 + length: 17 + - Comment: + content: Welcome message + span: + start: 510 + length: 19 + - Text: + content: "\n

Welcome, " + span: + start: 531 + length: 30 - Variable: bits: - user @@ -21,10 +37,23 @@ nodes: filters: - name: title arguments: [] + span: + start: 571 + length: 5 - name: default arguments: - "'Guest'" - - Text: "!

\n " + span: + start: 577 + length: 15 + span: + start: 561 + length: 31 + - Text: + content: "!\n " + span: + start: 598 + length: 23 - Block: block_type: Standard name: if @@ -32,23 +61,70 @@ nodes: - if - user.is_staff children: - - Text: "\n Admin\n " + - Text: + content: "\n Admin\n " + span: + start: 643 + length: 56 - Block: block_type: Branch name: else bits: [] children: - - Text: "\n User\n " + - Text: + content: "\n User\n " + span: + start: 709 + length: 55 + span: + start: 621 + length: 16 + tag_span: + start: 621 + length: 16 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "\n " + span: + start: 764 + length: 5 + tag_span: + start: 621 + length: 16 + span: + start: 621 + length: 148 + tag_span: + start: 621 + length: 16 + - Text: + content: "\n " + span: + start: 775 + length: 13 - Block: block_type: Closing name: endif bits: [] children: ~ - - Text: "\n
\n \n" + span: + start: 788 + length: 5 + tag_span: + start: 463 + length: 24 + span: + start: 463 + length: 330 + tag_span: + start: 463 + length: 24 + - Text: + content: "\n
\n \n" + span: + start: 799 + length: 35 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__full_templates__parse_full.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__full_templates__parse_full.snap.new deleted file mode 100644 index b0e59e0..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__full_templates__parse_full.snap.new +++ /dev/null @@ -1,132 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 725 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "\n\n \n \n \n \n \n \n
\n " - span: - start: 0 - length: 463 - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_authenticated - children: - - Text: - content: "\n " - span: - start: 493 - length: 17 - - Comment: - content: Welcome message - span: - start: 510 - length: 19 - - Text: - content: "\n

Welcome, " - span: - start: 531 - length: 30 - - Variable: - bits: - - user - - name - filters: - - name: title - arguments: [] - span: - start: 571 - length: 5 - - name: default - arguments: - - "'Guest'" - span: - start: 577 - length: 15 - span: - start: 561 - length: 31 - - Text: - content: "!

\n " - span: - start: 598 - length: 23 - - Block: - block_type: Standard - name: if - bits: - - if - - user.is_staff - children: - - Text: - content: "\n Admin\n " - span: - start: 643 - length: 56 - - Block: - block_type: Branch - name: else - bits: [] - children: - - Text: - content: "\n User\n " - span: - start: 709 - length: 55 - span: - start: 621 - length: 16 - tag_span: - start: 621 - length: 16 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 764 - length: 5 - tag_span: - start: 621 - length: 16 - span: - start: 621 - length: 148 - tag_span: - start: 621 - length: 16 - - Text: - content: "\n " - span: - start: 775 - length: 13 - - Block: - block_type: Closing - name: endif - bits: [] - children: ~ - span: - start: 788 - length: 5 - tag_span: - start: 463 - length: 24 - span: - start: 463 - length: 330 - tag_span: - start: 463 - length: 24 - - Text: - content: "\n
\n \n" - span: - start: 799 - length: 35 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap index 382062d..061d265 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "" + - Text: + content: "" + span: + start: 0 + length: 15 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap.new deleted file mode 100644 index a4f6d9a..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_doctype.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 457 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "" - span: - start: 0 - length: 15 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap index ba58268..a189e9a 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "
Hello
" + - Text: + content: "
Hello
" + span: + start: 0 + length: 34 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap.new deleted file mode 100644 index dc261f3..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_tag.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 466 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "
Hello
" - span: - start: 0 - length: 34 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap index aa6771b..01aa3f2 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "" + - Text: + content: "" + span: + start: 0 + length: 21 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap.new deleted file mode 100644 index 8227966..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__html__parse_html_void.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 475 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "" - span: - start: 0 - length: 21 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap index a0ea1da..1e0a35f 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "" + - Text: + content: "" + span: + start: 0 + length: 142 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap.new deleted file mode 100644 index 83d9d14..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__script__parse_script.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 574 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "" - span: - start: 0 - length: 142 -line_offsets: [] -errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap index 3256ac9..6313af8 100644 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap +++ b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap @@ -3,5 +3,10 @@ source: crates/djls-template-ast/src/parser.rs expression: ast --- nodes: - - Text: "" + - Text: + content: "" + span: + start: 0 + length: 97 +line_offsets: [] errors: [] diff --git a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap.new b/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap.new deleted file mode 100644 index 3005c45..0000000 --- a/crates/djls-template-ast/src/snapshots/djls_template_ast__parser__tests__style__parse_style.snap.new +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: crates/djls-template-ast/src/parser.rs -assertion_line: 592 -expression: ast -snapshot_kind: text ---- -nodes: - - Text: - content: "" - span: - start: 0 - length: 97 -line_offsets: [] -errors: []