[2.0.0-beta5] Validator: warnign if `..` operator is found

Created on 6 November 2024, about 2 months ago

Problem/Motivation

Lets use range() function instead of the .. built-in operator because:

  • .. is just syntactic sugar for the range() function. So, 1..items|length is the same as range(1, items|length), but without the possibility of adding a step
  • .. doesn't' exist in Jinja and Nunjucks, but range() function does.
  • Using a function will let us benefit for a check on function parameters we plan to introduce later

Proposed resolution

Raise a "Use range() function instead of `..` operator" warning if this is operator is found:

'..' => ['precedence' => 25, 'class' => RangeBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT],

Data model changes

Feature request
Status

Active

Version

2.0

Component

UI Patterns Devel [2.x only]

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024