Closed NduatiK closed 7 months ago
The new #{variable} syntax required for SwiftUI expects a float or integer variable.
#{variable}
To support both, we first attempt to convert the entire expr into an integer, if that fails we try converting it into a float.
If the variable is not a number, we return the original string.
For example if we had the following rule:
"h-" <> height do height(#{height}) end
The class h-abc would produce the ast for height("abc") and it would be up to the client to detect the error.
h-abc
height("abc")
Closing in favour of EEx support
The new
#{variable}
syntax required for SwiftUI expects a float or integer variable.To support both, we first attempt to convert the entire expr into an integer, if that fails we try converting it into a float.
If the variable is not a number, we return the original string.
For example if we had the following rule:
The class
h-abc
would produce the ast forheight("abc")
and it would be up to the client to detect the error.