-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Round-trip parsing and output generation causes difference in parsed result #165
Comments
I was surprised to see only one token. This is because you only call let mut tokens = Vec::new();
while let Ok(token) = parser.next_including_whitespace_and_comments() {
tokens.push(token)
} … and similarly for |
Blah, you're right. I fixed that and here's a new issue: extern crate cssparser;
use cssparser::ToCss;
fn main() {
let input = "/~*3E833";
println!("input:\n\t{:?}", input);
let mut parser_input = cssparser::ParserInput::new(input);
let mut parser = cssparser::Parser::new(&mut parser_input);
let mut tokens = vec![];
while let Ok(token) = parser.next_including_whitespace_and_comments() {
tokens.push(token)
}
println!("tokens:\n\t{:?}", tokens);
let str2 = tokens.iter().map(|t| t.to_css_string()).collect::<String>();
println!("tokens to string:\n\t{:?}", str2);
let mut parser_input = cssparser::ParserInput::new(&str2);
let mut parser = cssparser::Parser::new(&mut parser_input);
let mut tokens2 = vec![];
while let Ok(token) = parser.next_including_whitespace_and_comments() {
tokens2.push(token)
}
println!("tokens to string to tokens:\n\t{:?}", tokens2);
}
Looks like it's struggling with big numbers |
80: Fix cssparser read-write-read target to iterate correctly. r=killercup servo/rust-cssparser#165 (comment)
I’ve filed #167. If you want to keep fuzzing in the meantime, consider skipping cases where the serialization contains |
Found this while fuzzing.
The text was updated successfully, but these errors were encountered: