attr: rename State::{Attribute->Key}
more accurate name
This commit is contained in:
		
					parent
					
						
							
								86ee4ee520
							
						
					
				
			
			
				commit
				
					
						e1b12ba642
					
				
			
		
					 1 changed files with 5 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								src/attr.rs
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/attr.rs
									
										
									
									
									
								
							| 
						 | 
					@ -216,7 +216,7 @@ enum State {
 | 
				
			||||||
    Class,
 | 
					    Class,
 | 
				
			||||||
    IdentifierFirst,
 | 
					    IdentifierFirst,
 | 
				
			||||||
    Identifier,
 | 
					    Identifier,
 | 
				
			||||||
    Attribute,
 | 
					    Key,
 | 
				
			||||||
    ValueFirst,
 | 
					    ValueFirst,
 | 
				
			||||||
    Value,
 | 
					    Value,
 | 
				
			||||||
    ValueQuoted,
 | 
					    ValueQuoted,
 | 
				
			||||||
| 
						 | 
					@ -255,7 +255,7 @@ impl<I: Iterator<Item = char>> Parser<I> {
 | 
				
			||||||
                    '.' => ClassFirst,
 | 
					                    '.' => ClassFirst,
 | 
				
			||||||
                    '#' => IdentifierFirst,
 | 
					                    '#' => IdentifierFirst,
 | 
				
			||||||
                    '%' => Comment,
 | 
					                    '%' => 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,
 | 
					                    c if c.is_whitespace() => Whitespace,
 | 
				
			||||||
                    _ => Invalid,
 | 
					                    _ => Invalid,
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
| 
						 | 
					@ -288,9 +288,9 @@ impl<I: Iterator<Item = char>> Parser<I> {
 | 
				
			||||||
                        Invalid
 | 
					                        Invalid
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                Attribute => {
 | 
					                Key => {
 | 
				
			||||||
                    if is_name(c) {
 | 
					                    if is_name(c) {
 | 
				
			||||||
                        Attribute
 | 
					                        Key
 | 
				
			||||||
                    } else if c == '=' {
 | 
					                    } else if c == '=' {
 | 
				
			||||||
                        ValueFirst
 | 
					                        ValueFirst
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
| 
						 | 
					@ -375,7 +375,7 @@ impl<I: Iterator<Item = char>> Iterator for Parser<I> {
 | 
				
			||||||
                        _ => return Some(Element::Invalid),
 | 
					                        _ => return Some(Element::Invalid),
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                Attribute => {
 | 
					                Key => {
 | 
				
			||||||
                    let (st, _span1) = self.step();
 | 
					                    let (st, _span1) = self.step();
 | 
				
			||||||
                    match st {
 | 
					                    match st {
 | 
				
			||||||
                        ValueFirst => {
 | 
					                        ValueFirst => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue