remove assignments

This commit is contained in:
Josh Thomas 2025-01-06 22:21:49 -06:00
parent 1827f10be6
commit 43e6ea8054
13 changed files with 1547 additions and 28 deletions

View file

@ -114,7 +114,6 @@ pub enum Block {
tag: Tag, tag: Tag,
nodes: Vec<Node>, nodes: Vec<Node>,
closing: Option<Box<Block>>, closing: Option<Box<Block>>,
assignments: Option<Vec<Assignment>>,
}, },
Branch { Branch {
tag: Tag, tag: Tag,
@ -169,7 +168,6 @@ Block::Block {
tag: Tag, // The opening Tag of the block tag: Tag, // The opening Tag of the block
nodes: Vec<Node>, // Nodes contained within the block nodes: Vec<Node>, // Nodes contained within the block
closing: Option<Box<Block>>, // Contains Block::Closing if present closing: Option<Box<Block>>, // Contains Block::Closing if present
assignments: Option<Vec<Assignment>>, // Assignments declared within the tag
} }
``` ```

View file

@ -149,7 +149,6 @@ pub enum Block {
tag: Tag, tag: Tag,
nodes: Vec<Node>, nodes: Vec<Node>,
closing: Option<Box<Block>>, closing: Option<Box<Block>>,
assignments: Option<Vec<Assignment>>,
}, },
Branch { Branch {
tag: Tag, tag: Tag,
@ -193,13 +192,6 @@ impl Block {
} }
} }
pub fn assignments(&self) -> Option<&Vec<Assignment>> {
match self {
Block::Block { assignments, .. } => assignments.as_ref(),
_ => None,
}
}
pub fn template_name(&self) -> Option<&String> { pub fn template_name(&self) -> Option<&String> {
match self { match self {
Block::Inclusion { template_name, .. } => Some(template_name), Block::Inclusion { template_name, .. } => Some(template_name),
@ -324,7 +316,6 @@ mod tests {
}, },
nodes: vec![], nodes: vec![],
closing: None, closing: None,
assignments: None,
})]; })];
let ast = Ast { let ast = Ast {

View file

@ -153,7 +153,6 @@ impl Parser {
tag, tag,
nodes, nodes,
closing, closing,
assignments: None,
})) }))
} }

View file

@ -79,6 +79,5 @@ nodes:
start: 63 start: 63
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -59,6 +59,5 @@ nodes:
start: 55 start: 55
length: 6 length: 6
assignment: ~ assignment: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -36,6 +36,5 @@ nodes:
start: 40 start: 40
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -92,7 +92,6 @@ nodes:
start: 151 start: 151
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
- Variable: - Variable:
bits: bits:
- group - group
@ -135,7 +134,6 @@ nodes:
start: 223 start: 223
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
- Block: - Block:
Block: Block:
tag: tag:
@ -169,7 +167,6 @@ nodes:
start: 265 start: 265
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
- Block: - Block:
Branch: Branch:
tag: tag:
@ -202,7 +199,6 @@ nodes:
start: 317 start: 317
length: 6 length: 6
assignment: ~ assignment: ~
assignments: ~
- Block: - Block:
Branch: Branch:
tag: tag:
@ -235,7 +231,6 @@ nodes:
start: 351 start: 351
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
- Text: - Text:
content: "!" content: "!"
span: span:

View file

@ -56,7 +56,6 @@ nodes:
start: 61 start: 61
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
closing: closing:
Closing: Closing:
tag: tag:
@ -70,6 +69,5 @@ nodes:
start: 72 start: 72
length: 6 length: 6
assignment: ~ assignment: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -108,7 +108,6 @@ nodes:
start: 323 start: 323
length: 6 length: 6
assignment: ~ assignment: ~
assignments: ~
- Text: - Text:
content: "<footer>Page Footer</footer>" content: "<footer>Page Footer</footer>"
span: span:
@ -120,7 +119,6 @@ nodes:
start: 366 start: 366
length: 6 length: 6
closing: ~ closing: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0
- 24 - 24

View file

@ -29,6 +29,5 @@ nodes:
start: 26 start: 26
length: 9 length: 9
closing: ~ closing: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -24,6 +24,5 @@ nodes:
start: 30 start: 30
length: 7 length: 7
closing: ~ closing: ~
assignments: ~
line_offsets: line_offsets:
- 0 - 0

View file

@ -194,7 +194,6 @@ nodes:
start: 767 start: 767
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
closing: closing:
Closing: Closing:
tag: tag:
@ -208,7 +207,6 @@ nodes:
start: 791 start: 791
length: 5 length: 5
assignment: ~ assignment: ~
assignments: ~
- Text: - Text:
content: "</div>" content: "</div>"
span: span:

File diff suppressed because it is too large Load diff