From e1b12ba6427b8c36b9e9ca0e9409f2d2cfd7396a Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Fri, 17 Feb 2023 23:28:07 +0100 Subject: [PATCH] attr: rename State::{Attribute->Key} more accurate name --- src/attr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/attr.rs b/src/attr.rs index fb9cc33..7736e05 100644 --- a/src/attr.rs +++ b/src/attr.rs @@ -216,7 +216,7 @@ enum State { Class, IdentifierFirst, Identifier, - Attribute, + Key, ValueFirst, Value, ValueQuoted, @@ -255,7 +255,7 @@ impl> Parser { '.' => ClassFirst, '#' => IdentifierFirst, '%' => Comment, - c if c.is_ascii_alphanumeric() || matches!(c, '_' | ':' | '-') => Attribute, + c if c.is_ascii_alphanumeric() || matches!(c, '_' | ':' | '-') => Key, c if c.is_whitespace() => Whitespace, _ => Invalid, }, @@ -288,9 +288,9 @@ impl> Parser { Invalid } } - Attribute => { + Key => { if is_name(c) { - Attribute + Key } else if c == '=' { ValueFirst } else { @@ -375,7 +375,7 @@ impl> Iterator for Parser { _ => return Some(Element::Invalid), }) } - Attribute => { + Key => { let (st, _span1) = self.step(); match st { ValueFirst => {