Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 3, 2026

Summary

Change negated field syntax from !field to -field for consistency with tree-sitter query syntax.

Before: (node !field_name)
After: (node -field_name)

Rationale

The - prefix is more consistent with tree-sitter's negation conventions and avoids confusion with the ! operator in other contexts.

Changes

  • parser/cst.rs - Add Minus token
  • parser/grammar/fields.rs - Parse -field syntax, deprecation warning for !field
  • parser/grammar/expressions.rs - Handle both tokens
  • diagnostics/message.rs - Add deprecation warning
  • Updated tests and snapshots

Migration

Old !field syntax still works but emits a deprecation warning.

Test plan

  • All 705 tests pass
  • Clippy passes

@zharinov zharinov enabled auto-merge (squash) January 3, 2026 12:31
@zharinov zharinov merged commit 12f6088 into master Jan 3, 2026
4 checks passed
@zharinov zharinov deleted the refactor/negated-field-syntax branch January 3, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants