Skip to content

Commit

Permalink
Allow unitless metric values
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyelowo committed Oct 10, 2023
1 parent f32610c commit f32d5a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tw-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ fn parse_length_unit(input: &str) -> IResult<&str, String> {
tag("vw"),
tag("vmin"),
tag("vmax"),
// TODO: Should i allow unitless values? Would need something like this in caller
// location if so:
// let (input, _) = alt((parse_length_unit, parse_number))(input)?;
tag(""),
))
}(input)?;
Ok((input, format!("{}{}", number, unit)))
Expand Down Expand Up @@ -198,7 +202,8 @@ fn lengthy_arbitrary_classname(input: &str) -> IResult<&str, ()> {
let (input, _) = tag("[")(input)?;
let (input, _) = multispace0(input)?;
// is number
let (input, _) = alt((parse_length_unit, parse_number))(input)?;
// let (input, _) = alt((parse_length_unit, parse_number))(input)?;
let (input, _) = parse_length_unit(input)?;
let (input, _) = multispace0(input)?;
let (input, _) = tag("]")(input)?;
eprintln!("lengthy_arbitrary_classname: {}", input);
Expand Down

0 comments on commit f32d5a5

Please sign in to comment.