Skip to content

Commit 96a85ab

Browse files
committed
Bug 1680558 - Update cssparser to get ParserState in rule parser. r=heycam
The changes should be trivial. The third_party changes are up for review in servo/rust-cssparser#277 (and of course I'll land with a bump to 0.28 rather than the override after that gets r+'d). The basic idea is that with this we have the actual start offset of the rule, so we wouldn't include html comments or other invalid stuff we discard during sanitization in bug 1680084. But that's a separate change. Differential Revision: https://phabricator.services.mozilla.com/D98677
1 parent b2c4d4c commit 96a85ab

File tree

21 files changed

+77
-84
lines changed

21 files changed

+77
-84
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

devtools/shared/resources/tests/browser_resources_stylesheets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ const ADDITIONAL_RESOURCE = {
7171
mediaText: "all",
7272
matches: true,
7373
line: 1,
74-
column: 7,
74+
column: 1,
7575
},
7676
{
7777
conditionText: "print",
7878
mediaText: "print",
7979
matches: false,
8080
line: 1,
81-
column: 43,
81+
column: 37,
8282
},
8383
],
8484
};

layout/inspector/tests/test_getRelativeRuleLine.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
let tests = [
3232
{ sheetNo: 0, ruleNo: 0, lineNo: 1, columnNo: 1 },
33-
{ sheetNo: 1, ruleNo: 0, lineNo: 2, columnNo: 14 },
33+
{ sheetNo: 1, ruleNo: 0, lineNo: 2, columnNo: 5 },
3434
{ sheetNo: 1, ruleNo: 1, lineNo: 8, columnNo: 5 },
3535
{ sheetNo: 2, ruleNo: 0, lineNo: 1, columnNo: 1 },
3636
{ sheetNo: 2, ruleNo: 1, lineNo: 0, columnNo: 1 },

servo/components/malloc_size_of/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ accountable-refcell = { version = "0.2.0", optional = true }
3131
app_units = "0.7"
3232
content-security-policy = { version = "0.4.0", features = ["serde"], optional = true }
3333
crossbeam-channel = { version = "0.4", optional = true }
34-
cssparser = "0.27"
34+
cssparser = "0.28"
3535
euclid = "0.22"
3636
hashglobe = { path = "../hashglobe" }
3737
hyper = { version = "0.12", optional = true }

servo/components/selectors/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bench = []
2020
[dependencies]
2121
bitflags = "1.0"
2222
matches = "0.1"
23-
cssparser = "0.27"
23+
cssparser = "0.28"
2424
derive_more = "0.99"
2525
fxhash = "0.2"
2626
log = "0.4"

servo/components/style/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ arrayvec = "0.5"
3333
atomic_refcell = "0.1"
3434
bitflags = "1.0"
3535
byteorder = "1.0"
36-
cssparser = "0.27"
36+
cssparser = "0.28"
3737
derive_more = "0.99"
3838
new_debug_unreachable = "1.0"
3939
encoding_rs = {version = "0.8", optional = true}

servo/components/style/stylesheets/font_feature_values_rule.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::values::serialize_atom_identifier;
2020
use crate::Atom;
2121
use cssparser::{AtRuleParser, AtRuleType, BasicParseErrorKind, CowRcStr};
2222
use cssparser::{DeclarationListParser, DeclarationParser, Parser};
23-
use cssparser::{QualifiedRuleParser, RuleListParser, SourceLocation, Token};
23+
use cssparser::{QualifiedRuleParser, RuleListParser, SourceLocation, ParserState, Token};
2424
use std::fmt::{self, Write};
2525
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
2626

@@ -413,7 +413,7 @@ macro_rules! font_feature_values_blocks {
413413
fn parse_block<'t>(
414414
&mut self,
415415
prelude: BlockType,
416-
_location: SourceLocation,
416+
_: &ParserState,
417417
input: &mut Parser<'i, 't>
418418
) -> Result<Self::AtRule, ParseError<'i>> {
419419
debug_assert_eq!(self.context.rule_type(), CssRuleType::FontFeatureValues);

servo/components/style/stylesheets/keyframes_rule.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::str::CssStringWriter;
1717
use crate::stylesheets::rule_parser::VendorPrefix;
1818
use crate::stylesheets::{CssRuleType, StylesheetContents};
1919
use crate::values::{serialize_percentage, KeyframesName};
20-
use cssparser::{parse_one_rule, DeclarationListParser, DeclarationParser, SourceLocation, Token};
20+
use cssparser::{parse_one_rule, DeclarationListParser, DeclarationParser, ParserState, SourceLocation, Token};
2121
use cssparser::{AtRuleParser, CowRcStr, Parser, ParserInput, QualifiedRuleParser, RuleListParser};
2222
use servo_arc::Arc;
2323
use std::fmt::{self, Write};
@@ -533,7 +533,7 @@ impl<'a, 'i> QualifiedRuleParser<'i> for KeyframeListParser<'a> {
533533
fn parse_block<'t>(
534534
&mut self,
535535
selector: Self::Prelude,
536-
source_location: SourceLocation,
536+
start: &ParserState,
537537
input: &mut Parser<'i, 't>,
538538
) -> Result<Self::QualifiedRule, ParseError<'i>> {
539539
let context = ParserContext::new_with_rule_type(
@@ -566,7 +566,7 @@ impl<'a, 'i> QualifiedRuleParser<'i> for KeyframeListParser<'a> {
566566
Ok(Arc::new(self.shared_lock.wrap(Keyframe {
567567
selector,
568568
block: Arc::new(self.shared_lock.wrap(block)),
569-
source_location,
569+
source_location: start.source_location(),
570570
})))
571571
}
572572
}

servo/components/style/stylesheets/rule_parser.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::values::computed::font::FamilyName;
2727
use crate::values::{CssUrl, CustomIdent, KeyframesName};
2828
use crate::{Namespace, Prefix};
2929
use cssparser::{AtRuleParser, AtRuleType, Parser, QualifiedRuleParser, RuleListParser};
30-
use cssparser::{BasicParseError, BasicParseErrorKind, CowRcStr, SourceLocation};
30+
use cssparser::{BasicParseError, BasicParseErrorKind, CowRcStr, ParserState};
3131
use selectors::SelectorList;
3232
use servo_arc::Arc;
3333
use style_traits::{ParseError, StyleParseErrorKind};
@@ -251,10 +251,10 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
251251
fn parse_block<'t>(
252252
&mut self,
253253
prelude: AtRuleBlockPrelude,
254-
location: SourceLocation,
254+
start: &ParserState,
255255
input: &mut Parser<'i, 't>,
256256
) -> Result<CssRule, ParseError<'i>> {
257-
AtRuleParser::parse_block(&mut self.nested(), prelude, location, input).map(|rule| {
257+
AtRuleParser::parse_block(&mut self.nested(), prelude, start, input).map(|rule| {
258258
self.state = State::Body;
259259
rule
260260
})
@@ -264,8 +264,8 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
264264
fn rule_without_block(
265265
&mut self,
266266
prelude: AtRuleNonBlockPrelude,
267-
source_location: SourceLocation,
268-
) -> CssRule {
267+
start: &ParserState,
268+
) -> Self::AtRule {
269269
match prelude {
270270
AtRuleNonBlockPrelude::Import(url, media) => {
271271
let loader = self
@@ -274,7 +274,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
274274

275275
let import_rule = loader.request_stylesheet(
276276
url,
277-
source_location,
277+
start.source_location(),
278278
&self.context,
279279
&self.shared_lock,
280280
media,
@@ -296,7 +296,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
296296
CssRule::Namespace(Arc::new(self.shared_lock.wrap(NamespaceRule {
297297
prefix,
298298
url,
299-
source_location,
299+
source_location: start.source_location(),
300300
})))
301301
},
302302
}
@@ -324,10 +324,10 @@ impl<'a, 'i> QualifiedRuleParser<'i> for TopLevelRuleParser<'a> {
324324
fn parse_block<'t>(
325325
&mut self,
326326
prelude: Self::Prelude,
327-
location: SourceLocation,
327+
start: &ParserState,
328328
input: &mut Parser<'i, 't>,
329329
) -> Result<CssRule, ParseError<'i>> {
330-
QualifiedRuleParser::parse_block(&mut self.nested(), prelude, location, input).map(
330+
QualifiedRuleParser::parse_block(&mut self.nested(), prelude, start, input).map(
331331
|result| {
332332
self.state = State::Body;
333333
result
@@ -461,7 +461,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
461461
fn parse_block<'t>(
462462
&mut self,
463463
prelude: AtRuleBlockPrelude,
464-
source_location: SourceLocation,
464+
start: &ParserState,
465465
input: &mut Parser<'i, 't>,
466466
) -> Result<CssRule, ParseError<'i>> {
467467
match prelude {
@@ -473,7 +473,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
473473
);
474474

475475
Ok(CssRule::FontFace(Arc::new(self.shared_lock.wrap(
476-
parse_font_face_block(&context, input, source_location).into(),
476+
parse_font_face_block(&context, input, start.source_location()).into(),
477477
))))
478478
},
479479
AtRuleBlockPrelude::FontFeatureValues(family_names) => {
@@ -484,7 +484,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
484484
);
485485

486486
Ok(CssRule::FontFeatureValues(Arc::new(self.shared_lock.wrap(
487-
FontFeatureValuesRule::parse(&context, input, family_names, source_location),
487+
FontFeatureValuesRule::parse(&context, input, family_names, start.source_location()),
488488
))))
489489
},
490490
AtRuleBlockPrelude::CounterStyle(name) => {
@@ -495,14 +495,14 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
495495
);
496496

497497
Ok(CssRule::CounterStyle(Arc::new(self.shared_lock.wrap(
498-
parse_counter_style_body(name, &context, input, source_location)?.into(),
498+
parse_counter_style_body(name, &context, input, start.source_location())?.into(),
499499
))))
500500
},
501501
AtRuleBlockPrelude::Media(media_queries) => {
502502
Ok(CssRule::Media(Arc::new(self.shared_lock.wrap(MediaRule {
503503
media_queries,
504504
rules: self.parse_nested_rules(input, CssRuleType::Media),
505-
source_location,
505+
source_location: start.source_location(),
506506
}))))
507507
},
508508
AtRuleBlockPrelude::Supports(condition) => {
@@ -518,7 +518,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
518518
condition,
519519
rules: self.parse_nested_rules(input, CssRuleType::Supports),
520520
enabled,
521-
source_location,
521+
source_location: start.source_location(),
522522
},
523523
))))
524524
},
@@ -545,7 +545,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
545545
name,
546546
keyframes: parse_keyframe_list(&context, input, self.shared_lock),
547547
vendor_prefix,
548-
source_location,
548+
source_location: start.source_location(),
549549
},
550550
))))
551551
},
@@ -559,7 +559,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
559559
let declarations = parse_property_declaration_list(&context, input, None);
560560
Ok(CssRule::Page(Arc::new(self.shared_lock.wrap(PageRule {
561561
block: Arc::new(self.shared_lock.wrap(declarations)),
562-
source_location,
562+
source_location: start.source_location(),
563563
}))))
564564
},
565565
AtRuleBlockPrelude::Document(condition) => {
@@ -570,7 +570,7 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
570570
DocumentRule {
571571
condition,
572572
rules: self.parse_nested_rules(input, CssRuleType::Document),
573-
source_location,
573+
source_location: start.source_location(),
574574
},
575575
))))
576576
},
@@ -598,7 +598,7 @@ impl<'a, 'b, 'i> QualifiedRuleParser<'i> for NestedRuleParser<'a, 'b> {
598598
fn parse_block<'t>(
599599
&mut self,
600600
selectors: Self::Prelude,
601-
source_location: SourceLocation,
601+
start: &ParserState,
602602
input: &mut Parser<'i, 't>,
603603
) -> Result<CssRule, ParseError<'i>> {
604604
let context =
@@ -609,7 +609,7 @@ impl<'a, 'b, 'i> QualifiedRuleParser<'i> for NestedRuleParser<'a, 'b> {
609609
Ok(CssRule::Style(Arc::new(self.shared_lock.wrap(StyleRule {
610610
selectors,
611611
block,
612-
source_location,
612+
source_location: start.source_location(),
613613
}))))
614614
}
615615
}

servo/components/style_traits/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ gecko = []
1616
[dependencies]
1717
app_units = "0.7"
1818
bitflags = "1.0"
19-
cssparser = "0.27"
19+
cssparser = "0.28"
2020
euclid = "0.22"
2121
lazy_static = "1"
2222
malloc_size_of = { path = "../malloc_size_of" }

servo/components/to_shmem/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ servo = ["cssparser/serde", "string_cache"]
1414
gecko = []
1515

1616
[dependencies]
17-
cssparser = "0.27"
17+
cssparser = "0.28"
1818
servo_arc = { path = "../servo_arc" }
1919
smallbitvec = "2.1.1"
2020
smallvec = "1.0"

servo/ports/geckolib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ gecko_refcount_logging = ["style/gecko_refcount_logging", "servo_arc/gecko_refco
1616
[dependencies]
1717
atomic_refcell = "0.1"
1818
bincode = "1.0"
19-
cssparser = "0.27"
19+
cssparser = "0.28"
2020
cstr = "0.1.2"
2121
libc = "0.2"
2222
log = {version = "0.4", features = ["release_max_level_info"]}

servo/ports/geckolib/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
atomic_refcell = "0.1"
14-
cssparser = "0.27"
14+
cssparser = "0.28"
1515
cstr = "0.1.2"
1616
env_logger = { version = "0.8", default-features = false }
1717
geckoservo = {path = "../../../ports/geckolib"}

servo/tests/unit/style/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
byteorder = "1.0"
1414
app_units = "0.7"
15-
cssparser = "0.27"
15+
cssparser = "0.28"
1616
euclid = "0.22"
1717
html5ever = "0.22"
1818
parking_lot = "0.10"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"files":{"Cargo.toml":"53761c6ce14b954599553cc780908f422dc9e48b6183876a7be0e435fd200fa0","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"a533b45a9c43083c6a6000a9c99a1acfed123d6430b232352ae02f1144a09f12","build.rs":"a9619dbf086f20d3cbfee2b05c1a761f683acb30191d7286d24ad53617e9043b","build/match_byte.rs":"f57faf0597cb7b3e32999c5fb1215a43a5603121588c67d5031f720362171e1c","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"d2e14b341fbc2d141b1fed4b4a91b31e32bf92461b067036bd4227cda19e4e72","src/cow_rc_str.rs":"89b5dff5cf80eef3fcff0c11799e54a978d02d8b8963a621fbb999d35e7c03a3","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"2b20764b713020d59b7533ee686ef688ad70e85f61d2b3fab70e1af0f409f8e4","src/macros.rs":"cc5b13b5c605cd138b8311a9484d184fa3d063189e75d291223178f9eafe53c7","src/nth.rs":"2490db52a28d09009d73474336f12738ef5f0ffbbc4f1b49ee1e56ca9ca8b34b","src/parser.rs":"3bfeeda068567699e6ff5a6967c95473bc99910aedceb406347e05a98339cdac","src/rules_and_declarations.rs":"19d0079eca3e1776823ef8a16a0afd1619b9f7a392068c583487d891674225b2","src/serializer.rs":"c3b810e0970688a40d279101c379cfee110b100e1ff1a2cc40363971fd7bf591","src/size_of_tests.rs":"acd10556e060e4149e9f565f36058ca26bf3b3296d512d45127845fa12b94539","src/tests.rs":"247b0b332e77c1703ffbaaad9b5540571609e0fdc49f91998171820619d06f03","src/tokenizer.rs":"76360e46c0efceff82b6336b3522c95bdb8ef96379a617e7eed12eec9bad7ab7","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":"754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a"}
1+
{"files":{"Cargo.toml":"3433246693b26ae30214281dadded990707a23c70bc915ee2ca5b1482f15b05c","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"a533b45a9c43083c6a6000a9c99a1acfed123d6430b232352ae02f1144a09f12","build.rs":"a9619dbf086f20d3cbfee2b05c1a761f683acb30191d7286d24ad53617e9043b","build/match_byte.rs":"f57faf0597cb7b3e32999c5fb1215a43a5603121588c67d5031f720362171e1c","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"d8f574e2b6b3f5c144e5030037eb5e9db31d96d484a60e6503ca98395fd7f3af","src/cow_rc_str.rs":"89b5dff5cf80eef3fcff0c11799e54a978d02d8b8963a621fbb999d35e7c03a3","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"2b20764b713020d59b7533ee686ef688ad70e85f61d2b3fab70e1af0f409f8e4","src/macros.rs":"cc5b13b5c605cd138b8311a9484d184fa3d063189e75d291223178f9eafe53c7","src/nth.rs":"ae2f8b0f2c9e8b1ffb3cb842ca78c0060829a7d2e0762d1eb427f40188686ba1","src/parser.rs":"5c8ed6ccc069d0d2526016aeeba7200275b5fb1d8271926ccdb7a848124cde45","src/rules_and_declarations.rs":"1f171431f5f4d0d6bd631deeb7c684100c6e15f10e06b8fff1e6d676567c27c3","src/serializer.rs":"c3b810e0970688a40d279101c379cfee110b100e1ff1a2cc40363971fd7bf591","src/size_of_tests.rs":"acd10556e060e4149e9f565f36058ca26bf3b3296d512d45127845fa12b94539","src/tests.rs":"8022811a7fc90199e1f775fb1cf567ac15fca8a00d5f2cf934863a8b36997cba","src/tokenizer.rs":"76360e46c0efceff82b6336b3522c95bdb8ef96379a617e7eed12eec9bad7ab7","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":"809d22aba9ffd53e9028f2d37261f1826ef613d0e96b1a5ddeefa97cde82bcca"}

third_party/rust/cssparser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[package]
1414
edition = "2018"
1515
name = "cssparser"
16-
version = "0.27.2"
16+
version = "0.28.0"
1717
authors = ["Simon Sapin <[email protected]>"]
1818
build = "build.rs"
1919
exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"]

third_party/rust/cssparser/src/color.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl Color {
291291
let name = name.clone();
292292
return input.parse_nested_block(|arguments| {
293293
parse_color_function(component_parser, &*name, arguments)
294-
})
294+
});
295295
}
296296
_ => Err(()),
297297
}

third_party/rust/cssparser/src/nth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ pub fn parse_nth<'i, 't>(input: &mut Parser<'i, 't>) -> Result<(i32, i32), Basic
7373
ref token => {
7474
let token = token.clone();
7575
Err(input.new_basic_unexpected_token_error(token))
76-
},
76+
}
7777
},
7878
ref token => {
7979
let token = token.clone();
8080
Err(input.new_basic_unexpected_token_error(token))
81-
},
81+
}
8282
}
8383
}
8484

third_party/rust/cssparser/src/parser.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,17 +933,15 @@ impl<'i: 't, 't> Parser<'i, 't> {
933933
Ok(&Token::Function(_))
934934
| Ok(&Token::ParenthesisBlock)
935935
| Ok(&Token::SquareBracketBlock)
936-
| Ok(&Token::CurlyBracketBlock) => {
937-
self.parse_nested_block(|input| {
938-
input.expect_no_error_token().map_err(Into::into)
939-
}).map_err(ParseError::<()>::basic)?
940-
}
936+
| Ok(&Token::CurlyBracketBlock) => self
937+
.parse_nested_block(|input| input.expect_no_error_token().map_err(Into::into))
938+
.map_err(ParseError::<()>::basic)?,
941939
Ok(t) => {
942940
// FIXME: maybe these should be separate variants of
943941
// BasicParseError instead?
944942
if t.is_parse_error() {
945943
let token = t.clone();
946-
return Err(self.new_basic_unexpected_token_error(token))
944+
return Err(self.new_basic_unexpected_token_error(token));
947945
}
948946
}
949947
Err(_) => return Ok(()),

0 commit comments

Comments
 (0)