LibWeb: Include sign in token debug info, if the type has explicit sign

This commit is contained in:
stelar7 2022-05-07 23:59:36 +02:00 committed by Linus Groh
parent 5ca8e2a751
commit 2b3c07f4ad
Notes: sideshowbarker 2024-07-17 11:09:30 +09:00

View file

@ -106,7 +106,7 @@ String Token::to_debug_string() const
case Type::Delim:
return String::formatted("Delim: {}", m_value);
case Type::Number:
return String::formatted("Number: {} (number_type: {})", m_number_value.value(), m_number_value.is_integer() ? "Integer" : "Number");
return String::formatted("Number: {}{} (number_type: {})", m_number_value.value() > 0 && m_number_value.is_integer_with_explicit_sign() ? "+" : "", m_number_value.value(), m_number_value.is_integer() ? "Integer" : "Number");
case Type::Percentage:
return String::formatted("Percentage: {}% (number_type: {})", percentage(), m_number_value.is_integer() ? "Integer" : "Number");
case Type::Dimension: