mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-11 21:06:31 +00:00
revert
This commit is contained in:
parent
43b5c78bfc
commit
f391e0de9c
1 changed files with 8 additions and 15 deletions
|
@ -155,26 +155,19 @@ impl Parser {
|
|||
|
||||
let specs = TagSpec::load_builtin_specs().unwrap_or_default();
|
||||
|
||||
// Check if this is a closing tag
|
||||
// Check if this is a closing or branch tag
|
||||
for (_, spec) in specs.iter() {
|
||||
if Some(&tag_name) == spec.closing.as_ref() {
|
||||
// let node = Node::Django(DjangoNode::Tag(TagNode::Closing {
|
||||
// name: tag_name.clone(),
|
||||
// bits: bits[1..].to_vec(),
|
||||
// }));
|
||||
if Some(&tag_name) == spec.closing.as_ref()
|
||||
|| spec
|
||||
.branches
|
||||
.as_ref()
|
||||
.map(|ints| ints.iter().any(|i| i.name == tag_name))
|
||||
.unwrap_or(false)
|
||||
{
|
||||
return Err(ParserError::ErrorSignal(Signal::SpecialTag(tag_name)));
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this is a branch tag according to any spec
|
||||
for (_, spec) in specs.iter() {
|
||||
if let Some(branches) = &spec.branches {
|
||||
if branches.iter().any(|i| i.name == tag_name) {
|
||||
return Err(ParserError::ErrorSignal(Signal::SpecialTag(tag_name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let tag_spec = specs.get(tag_name.as_str()).cloned();
|
||||
let mut children = Vec::new();
|
||||
let mut current_branch: Option<(String, Vec<String>, Vec<Node>)> = None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue