adobe / htl-spec

HTML Template Language Specification
Apache License 2.0
280 stars 146 forks source link

Comparison operator issue #71

Closed karollewandowski closed 5 years ago

karollewandowski commented 5 years ago

I noticed one issue with grammar when compared it to ANTLR grammar in Sling implementation project. The comparison operation is incorrect:

comparisonOp = factor {, comparisonOperator, factor};

Such rule would allow to create expression like:

1 < 2 < 3 < 4

Implementation restricts such constructs (I simplified it for readability):

comparisonTerm : factor | factor comparisonOp factor;
raducotescu commented 5 years ago

@karollewandowski, you're right. The grammar here should have used the [ ] braces to indicate a zero or one matching.