MCPcopy Create free account
hub / github.com/csskit/csskit / consume_escape_whitespace

Method consume_escape_whitespace

crates/css_lexer/src/syntax/parse_escape.rs:48–66  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

46 }
47
48 fn consume_escape_whitespace(&mut self) -> u8 {
49 if let Some(next_char) = self.as_str().chars().next()
50 && is_whitespace(next_char)
51 {
52 self.next();
53 // https://drafts.csswg.org/css-syntax/#input-preprocessing
54 // Replace any U+000D CARRIAGE RETURN (CR) code points, U+000C FORM FEED (FF) code points,
55 // or pairs of U+000D CARRIAGE RETURN (CR) followed by U+000A LINE FEED (LF) in input by
56 // single U+000A LINE FEED (LF) code point.
57 if next_char == '\r' && self.as_str().starts_with('\n') {
58 self.next();
59 2
60 } else {
61 1
62 }
63 } else {
64 0
65 }
66 }
67
68 fn parse_escape_sequence(&mut self) -> (char, u8) {
69 if let Some(c) = self.next() {

Callers 1

parse_escape_sequenceMethod · 0.45

Calls 3

is_whitespaceFunction · 0.85
nextMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected