Create AtRuleKind::Else variant

This commit is contained in:
ConnorSkees 2020-01-20 18:21:07 -05:00
parent a7ca888942
commit efe056d3c7
2 changed files with 16 additions and 0 deletions

View File

@ -170,6 +170,7 @@ pub enum AtRuleKind {
/// Prints a message for debugging purposes /// Prints a message for debugging purposes
Debug, Debug,
If, If,
Else,
Each, Each,
For, For,
While, While,
@ -231,6 +232,7 @@ impl TryFrom<&str> for AtRuleKind {
"warn" => Ok(Self::Warn), "warn" => Ok(Self::Warn),
"debug" => Ok(Self::Debug), "debug" => Ok(Self::Debug),
"if" => Ok(Self::If), "if" => Ok(Self::If),
"else" => Ok(Self::Else),
"each" => Ok(Self::Each), "each" => Ok(Self::Each),
"for" => Ok(Self::For), "for" => Ok(Self::For),
"while" => Ok(Self::While), "while" => Ok(Self::While),
@ -271,6 +273,7 @@ impl Display for AtRuleKind {
Self::Warn => write!(f, "@warn"), Self::Warn => write!(f, "@warn"),
Self::Debug => write!(f, "@debug"), Self::Debug => write!(f, "@debug"),
Self::If => write!(f, "@if"), Self::If => write!(f, "@if"),
Self::Else => write!(f, "@else"),
Self::Each => write!(f, "@each"), Self::Each => write!(f, "@each"),
Self::For => write!(f, "@for"), Self::For => write!(f, "@for"),
Self::While => write!(f, "@while"), Self::While => write!(f, "@while"),

View File

@ -487,6 +487,19 @@ fn eat_at_rule<I: Iterator<Item = Token>>(
}; };
Ok(Expr::MixinDecl(name, mixin)) Ok(Expr::MixinDecl(name, mixin))
} }
AtRuleKind::Use => todo!("@use not yet implemented"),
AtRuleKind::Annotation => todo!("@annotation not yet implemented"),
AtRuleKind::AtRoot => todo!("@at-root not yet implemented"),
AtRuleKind::Charset => todo!("@charset not yet implemented"),
AtRuleKind::Each => todo!("@each not yet implemented"),
AtRuleKind::Extend => todo!("@extend not yet implemented"),
AtRuleKind::If => todo!("@if not yet implemented"),
AtRuleKind::Else => todo!("@else not yet implemented"),
AtRuleKind::For => todo!("@for not yet implemented"),
AtRuleKind::While => todo!("@while not yet implemented"),
AtRuleKind::Media => todo!("@media not yet implemented"),
AtRuleKind::Function => todo!("@function not yet implemented"),
AtRuleKind::Keyframes => todo!("@keyframes not yet implemented"),
_ => todo!("encountered unimplemented at rule"), _ => todo!("encountered unimplemented at rule"),
} }
} }