From 73fa2eda2c23bd3baeb9e22b99eb0bfb183fc638 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Tue, 1 Jun 2021 14:56:02 +0200 Subject: Introduce `fr`s --- src/parse/tokens.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/parse/tokens.rs') diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs index 74051801..9d3cbc9a 100644 --- a/src/parse/tokens.rs +++ b/src/parse/tokens.rs @@ -393,6 +393,7 @@ impl<'s> Tokens<'s> { // Otherwise parse into the fitting numeric type. let build = match suffix { "%" => Token::Percent, + "fr" => Token::Fraction, "pt" => |x| Token::Length(x, LengthUnit::Pt), "mm" => |x| Token::Length(x, LengthUnit::Mm), "cm" => |x| Token::Length(x, LengthUnit::Cm), @@ -880,6 +881,7 @@ mod tests { let suffixes = [ ("%", Percent as fn(f64) -> Token<'static>), + ("fr", Fraction as fn(f64) -> Token<'static>), ("mm", |x| Length(x, LengthUnit::Mm)), ("pt", |x| Length(x, LengthUnit::Pt)), ("cm", |x| Length(x, LengthUnit::Cm)), -- cgit v1.2.3