Add support for declaration tokens
This commit is contained in:
parent
eb2cfd59f9
commit
53d882e067
|
@ -302,6 +302,10 @@ impl<'xml> Iterator for Context<'xml> {
|
||||||
Ok(Token::Text { text }) => {
|
Ok(Token::Text { text }) => {
|
||||||
return Some(Ok(Node::Text(text.as_str())));
|
return Some(Ok(Node::Text(text.as_str())));
|
||||||
}
|
}
|
||||||
|
Ok(Token::Declaration { .. }) => match self.stack.is_empty() {
|
||||||
|
false => return Some(Err(Error::UnexpectedToken(format!("{:?}", token)))),
|
||||||
|
true => {}
|
||||||
|
},
|
||||||
Ok(token) => return Some(Err(Error::UnexpectedToken(format!("{:?}", token)))),
|
Ok(token) => return Some(Err(Error::UnexpectedToken(format!("{:?}", token)))),
|
||||||
Err(e) => return Some(Err(Error::Parse(e))),
|
Err(e) => return Some(Err(Error::Parse(e))),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue