stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 224 forks source link

Boolean expression: parenthesis need to be surrounded by spaces #253

Closed djbe closed 6 years ago

djbe commented 6 years ago

Refs #165.

This is either a bug in the implementation, or in the documentation. The docs say: {% if (one or two) and three %} But that won't work. It'll throw a "dangling token" error. What does work is: {% if ( one or two ) and three %}

The reason is that the current implementation is just built on top of the components array received from the token parser, which separates by spaces. @ilyapuchka thoughts?

ilyapuchka commented 6 years ago

it shouldn't be like that, I need to look into that later