Files
Copilot d250d620ad Fix not keyword silently ignored when used without parentheses in conditions (#4421)
* Initial plan

* Fix: not keyword now works without parentheses in guard conditions

Previously, `boolean(not false)` silently ignored the `not` keyword
while `boolean(not (false))` worked correctly.

The `negatedCondition` parser function consumed the `not` keyword but
only tried `parenthesisCondition`, which requires `(`. With no parens,
it returned undefined with `not` already consumed, causing silent skip.

Fix: fall back to `atomicCondition` when `parenthesisCondition` fails,
allowing both `not false` and `not (false)` to work consistently.

Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com>

* Restrict not-without-parens to simple values only (keywords/variables)

Complex conditions like `not 2 < 1` still require parentheses,
keeping alignment with CSS media query syntax. Only simple bare
values (keywords, variables, quoted strings) are allowed after
`not` without parens: `not false`, `not @var`.

Remove the `boolean(not 2 < 1)` test case that relied on the
broader atomicCondition fallback.

Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com>
Co-authored-by: Matthew Dean <matthew-dean@users.noreply.github.com>
2026-03-19 15:47:25 -07:00
..