diff options
Diffstat (limited to 'src/tokenizer/char_ref')
-rw-r--r-- | src/tokenizer/char_ref/mod.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tokenizer/char_ref/mod.rs b/src/tokenizer/char_ref/mod.rs index 7b27bff..41f4c13 100644 --- a/src/tokenizer/char_ref/mod.rs +++ b/src/tokenizer/char_ref/mod.rs @@ -145,13 +145,13 @@ impl CharRefTokenizer { tokenizer.discard_char(input); self.state = Octothorpe; Progress - }, + } _ => { self.state = Named; self.name_buf_opt = Some(String::new()); Progress - }, + } } } @@ -166,12 +166,12 @@ impl CharRefTokenizer { tokenizer.discard_char(input); self.hex_marker = Some(c); self.state = Numeric(16); - }, + } _ => { self.hex_marker = None; self.state = Numeric(10); - }, + } } Progress } @@ -195,14 +195,14 @@ impl CharRefTokenizer { self.num = self.num.wrapping_add(n); self.seen_digit = true; Progress - }, + } None if !self.seen_digit => self.unconsume_numeric(tokenizer, input), None => { self.state = NumericSemicolon; Progress - }, + } } } @@ -287,7 +287,7 @@ impl CharRefTokenizer { } // Otherwise we just have a prefix match. Progress - }, + } // Can't continue the match. None => self.finish_named(tokenizer, input, Some(c)), @@ -322,7 +322,7 @@ impl CharRefTokenizer { // we emit a parse error. self.state = BogusName; return Progress; - }, + } // Check length because &; is not a parse error. Some(';') if self.name_buf().len() > 1 => self.emit_name_error(tokenizer), @@ -331,7 +331,7 @@ impl CharRefTokenizer { } self.unconsume_name(input); self.finish_none() - }, + } Some((c1, c2)) => { // We have a complete match, but we may have consumed @@ -371,14 +371,14 @@ impl CharRefTokenizer { "Equals sign after character reference in attribute", )); true - }, + } (Some(_), _, Some(c)) if is_ascii_alnum(c) => true, _ => { tokenizer.emit_error(Borrowed( "Character reference does not end with semicolon", )); false - }, + } }; if unconsume_all { @@ -392,7 +392,7 @@ impl CharRefTokenizer { }); Done } - }, + } } } @@ -426,20 +426,20 @@ impl CharRefTokenizer { Numeric(_) | NumericSemicolon => { tokenizer.emit_error(Borrowed("EOF in numeric character reference")); self.finish_numeric(tokenizer); - }, + } Named => drop(self.finish_named(tokenizer, input, None)), BogusName => { self.unconsume_name(input); self.finish_none(); - }, + } Octothorpe => { input.push_front(String::from("#")); tokenizer.emit_error(Borrowed("EOF after '#' in character reference")); self.finish_none(); - }, + } } } } |