mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update to cssparser 0.19, count line numbers during tokenization
This commit is contained in:
parent
32f835260c
commit
7382dad939
33 changed files with 145 additions and 196 deletions
|
@ -194,7 +194,7 @@ impl CalcNode {
|
|||
let mut root = Self::parse_product(context, input, expected_unit)?;
|
||||
|
||||
loop {
|
||||
let position = input.position();
|
||||
let start = input.state();
|
||||
match input.next_including_whitespace() {
|
||||
Ok(&Token::WhiteSpace(_)) => {
|
||||
if input.is_exhausted() {
|
||||
|
@ -220,7 +220,7 @@ impl CalcNode {
|
|||
}
|
||||
}
|
||||
_ => {
|
||||
input.reset(position);
|
||||
input.reset(&start);
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ impl CalcNode {
|
|||
let mut root = Self::parse_one(context, input, expected_unit)?;
|
||||
|
||||
loop {
|
||||
let position = input.position();
|
||||
let start = input.state();
|
||||
match input.next() {
|
||||
Ok(&Token::Delim('*')) => {
|
||||
let rhs = Self::parse_one(context, input, expected_unit)?;
|
||||
|
@ -261,7 +261,7 @@ impl CalcNode {
|
|||
root = new_root;
|
||||
}
|
||||
_ => {
|
||||
input.reset(position);
|
||||
input.reset(&start);
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,12 +70,12 @@ impl Parse for Color {
|
|||
// Currently we only store authored value for color keywords,
|
||||
// because all browsers serialize those values as keywords for
|
||||
// specified value.
|
||||
let start_position = input.position();
|
||||
let start = input.state();
|
||||
let authored = match input.next() {
|
||||
Ok(&Token::Ident(ref s)) => Some(s.to_lowercase().into_boxed_str()),
|
||||
_ => None,
|
||||
};
|
||||
input.reset(start_position);
|
||||
input.reset(&start);
|
||||
match input.try(CSSParserColor::parse) {
|
||||
Ok(value) =>
|
||||
Ok(match value {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue