liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Test invalid floats without integer parts

Open peterzhu2118 opened this issue 5 years ago • 3 comments

Add tests for Shopify/liquid-c#120.

peterzhu2118 avatar Nov 05 '20 14:11 peterzhu2118

Based on https://github.com/Shopify/liquid-c/pull/123, it looks like we actually have themes that depend on this liquid quirk.

We might want to consider just supporting that syntax. It isn't actually that unreasonable. For example, it is valid syntax in python

$ python
Python 3.10.3 (main, Jul  4 2022, 12:12:23) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> -.1
-0.1

It is also considered acceptable syntax in math, even though the 0 preceding the decimal point is typically preferred for readability.

dylanahsmith avatar Oct 31 '22 13:10 dylanahsmith

Boa tarde, já não tenho a loja online, por favor podem anular a minha subscrição. Obrigado. Maria Lopes

Dylan Thacker-Smith @.***> escreveu no dia segunda, 31/10/2022 à(s) 13:25:

Based on Shopify/liquid-c#123 https://github.com/Shopify/liquid-c/pull/123, it looks like we actually have themes that depend on this liquid quirk.

We might want to consider just supporting that syntax. It isn't actually that unreasonable. For example, it is valid syntax in python

$ python Python 3.10.3 (main, Jul 4 2022, 12:12:23) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin Type "help", "copyright", "credits" or "license" for more information.

-.1 -0.1

It is also considered acceptable syntax in math, even though the 0 preceding the decimal point is typically preferred for readability.

— Reply to this email directly, view it on GitHub https://github.com/Shopify/liquid/pull/1343#issuecomment-1297084608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZRI4DOKUAWWXMWA7Z2XH6TWF7CDHANCNFSM4TLOFQCQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ghost avatar Oct 31 '22 14:10 ghost