3 Commits
Author SHA1 Message Date
Antonio PallaresandCursor 2c5f57a83c Share one arity check across the strict operators (#7571)
Seven operators hand-wrote the same count check and the same message.
Move it to Operators, next to evalArgs, whose result it always checks.

Messages are unchanged, so no fixture moves.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 13:09:59 +02:00
Antonio Pallares 2025b9b18f Match the separator by code unit in rc.split (#7551) 2026-09-01 08:20:27 +00:00
Antonio PallaresandCursor ee1e91f0aa Add rc.split custom operator (#7473)
Splits a string into an array of fields, keeping empty ones, so rules can
target locale subtags, product-id namespaces and similar composite values.

A var path cannot index the result of an expression, so a positional field
is read by wrapping the array in a one-element list and letting an
iteration operator rebind scope to it. The array is also usable directly
by in and by the iteration operators.

Fields are never coerced to numbers, and a non-string operand or empty
separator throws typeMismatch rather than splitting into characters.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 09:47:39 +02:00