Skip to content

feat!: reserved rules api, enum consts, const attributes, 0.24.0#275

Merged
calebdw merged 8 commits intomasterfrom
calebdw/push-ytvkkqkkxrww
Aug 11, 2025
Merged

feat!: reserved rules api, enum consts, const attributes, 0.24.0#275
calebdw merged 8 commits intomasterfrom
calebdw/push-ytvkkqkkxrww

Conversation

@calebdw
Copy link
Copy Markdown
Collaborator

@calebdw calebdw commented Jun 2, 2025

This supersedes @amaanq's work in #263

  • use new reserved rules api
  • feat: add support for attributes on global constants PHP 8.5
  • feat: add php_end_tag to grammar and queries
  • fix: enums can have class constants
  • test: add test for async visibility on static properties
  • bumps version to 0.24.0

Closes #272, closes #273, closes #279

Base automatically changed from calebdw/push-wqttnrqlwoql to master June 2, 2025 12:50
@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 67dd943 to 794d67e Compare June 2, 2025 13:12
@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 794d67e to 9166e6b Compare June 14, 2025 22:29
@calebdw calebdw requested a review from amaanq June 14, 2025 22:31
@calebdw
Copy link
Copy Markdown
Collaborator Author

calebdw commented Jun 14, 2025

@amaanq, can you please look at this when you get the chance? I'm not sure if I'm doing something wrong (most likely) or if there's a bug in the reserved functionality...

This test should produce an ERROR:

=========================================
Global constants can't use reserved keywords
=========================================

<?php

const CLASS = 1; // should be an error

---

(program
  (php_tag)
  (const_declaration
    (ERROR
      (integer)))
  (comment))

because class is in the global reserved keyword list, but it's correctly parsing it

@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 9166e6b to 2206b02 Compare June 14, 2025 23:01
@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 2206b02 to 5f4ad08 Compare June 17, 2025 03:11
@calebdw calebdw changed the title feat!: use the new reserved rules api feat!: reserved rules api, enum consts, const attributes, 0.24.0 Jun 17, 2025
@calebdw calebdw requested a review from cfroystad June 17, 2025 03:21
@calebdw
Copy link
Copy Markdown
Collaborator Author

calebdw commented Jun 17, 2025

@cfroystad, can you please review? I just forewent the failing test

@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 76cc103 to 0a3bdcc Compare July 2, 2025 12:46
@calebdw calebdw force-pushed the calebdw/push-ytvkkqkkxrww branch from 0a3bdcc to a54c9f2 Compare July 2, 2025 12:47
@calebdw
Copy link
Copy Markdown
Collaborator Author

calebdw commented Jul 2, 2025

@cfroystad, just wanted to ping you for review, I hope everything is going good!

@cfroystad
Copy link
Copy Markdown
Collaborator

Thanks for your patience and sorry for the delay! I've just been too busy. Will try to find time to review this week or next week the latest. At a glance, this looks very good!

@calebdw
Copy link
Copy Markdown
Collaborator Author

calebdw commented Jul 30, 2025

No worries sir! I understand how busy life can get sometimes :)

@calebdw calebdw merged commit 182f034 into master Aug 11, 2025
4 checks passed
@calebdw calebdw deleted the calebdw/push-ytvkkqkkxrww branch August 11, 2025 12:23
Roardom added a commit to Roardom/zed-php that referenced this pull request Dec 16, 2025
To v0.24.2 and v0.1.7 respectfully. Enables features of PHP 8.4 and 8.5.

- tree-sitter/tree-sitter-php#275
  - `php_end_tag` was added
  - `callable` is no longer a keyword
- tree-sitter/tree-sitter-php#237
  - `string_value` was replaced with `string_content`
  - `modifier` field was removed from `class_declaration`
- Various
  - `yield` and `from` are converted to `yield` and `yield from`
Roardom added a commit to Roardom/zed-php that referenced this pull request Dec 16, 2025
To v0.24.2 and v0.1.7 respectively. Enables features of PHP 8.4 and 8.5.

- tree-sitter/tree-sitter-php#275
  - `php_end_tag` was added
  - `callable` is no longer a keyword
- tree-sitter/tree-sitter-php#237
  - `string_value` was replaced with `string_content`
  - `modifier` field was removed from `class_declaration`
- Various
  - `yield` and `from` are converted to `yield` and `yield from`
Roardom added a commit to Roardom/zed-php that referenced this pull request Jan 29, 2026
To v0.24.2 and v0.1.7 respectively. Enables features of PHP 8.4 and 8.5.

- tree-sitter/tree-sitter-php#275
  - `php_end_tag` was added
  - `callable` is no longer a keyword
- tree-sitter/tree-sitter-php#237
  - `string_value` was replaced with `string_content`
  - `modifier` field was removed from `class_declaration`
- Various
  - `yield` and `from` are converted to `yield` and `yield from`
MrSubidubi pushed a commit to zed-extensions/php that referenced this pull request Feb 2, 2026
To v0.24.2 and v0.1.7 respectively. Enables features of PHP 8.4 and 8.5.

- tree-sitter/tree-sitter-php#275
  - `php_end_tag` was added
  - `callable` is no longer a keyword
- tree-sitter/tree-sitter-php#237
  - `string_value` was replaced with `string_content`
  - `modifier` field was removed from `class_declaration`
- Various
  - `yield` and `from` are converted to `yield` and `yield from`
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.

feature: add new node for ?> feature: Enumeration constants issue: tree-sitter-php python package updates

2 participants