Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion wayfire/lexer/literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ variant_t parse_literal(const std::string &s)
}

// Deal with float or double here.
if (std::count(std::begin(s), std::end(s), '.') == 1)
//original if (std::count(std::begin(s), std::end(s), '.') == 1)
bool numeric_like = std::all_of(s.begin(), s.end(),
[](char c)
{
return std::isdigit(c) || c == '.' || c == '-' || c == '+' || c == 'f' || c == 'F';
});

if (numeric_like && std::count(s.begin(), s.end(), '.') == 1)

{
// Float or Double.
if ((s.find('f') != std::string::npos) || (s.find('F') != std::string::npos))
Expand Down