You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TOLERANT_TODO.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,28 +14,34 @@ This branch tracks work needed to bring the tolerant PHP parser up to date for P
14
14
15
15
### PHP 8.3
16
16
17
-
Most 8.3 constructs parse, but we should explicitly verify:
17
+
Double-check tolerant against the language changes that shipped with 8.3:
18
18
19
-
-`readonly` refinements (interfaces, class constants) – ensure new modifiers propagate through `Parser` and AST classes.
20
-
- Enum improvements (interface inheritance rules, optional `implements` lists) – confirm grammar and diagnostics still match php-src.
21
-
- Property initialisers inside `readonly` classes behave the same as php-ast output.
19
+
-**Dynamic class constant fetch** (`Foo::{expr}`): ensure tokenizer/grammar accept brace-wrapped expressions after `::`, add fixtures, and mirror php-ast node structure.
20
+
-**Typed class constants / readonly amendments**: confirm class-constant declarations propagate their type information and `readonly` constraints into tolerant AST output.
21
+
-**`#[\Override]` attribute**: attributes already parse, but we should add fixtures to verify tolerant preserves them on methods.
22
+
-**Arbitrary static variable initialisers**: while this is largely semantic, tolerant should accept the new grammar in function-level `static` declarations and update diagnostics if necessary.
22
23
23
24
### PHP 8.4
24
25
25
-
-**Property hooks** (`public int $count { get => $this->value; set { ... } }`).
26
-
- Extend the tokenizer/grammar so `get`/`set` in this context become dedicated tokens (not identifiers).
27
-
- Update AST node classes to represent hook lists and bodies.
28
-
- Adjust diagnostics and tolerant AST converter (in Phan) to populate the `hooks` child.
29
-
- New attribute placements (e.g. attributes on `class const`, hook blocks) must be accepted and serialized.
30
-
-`readonly` class improvements and intersection types: confirm parser emits the correct flags and up-to-date diagnostics.
26
+
-**Property access hooks** (`public int $count { get => ...; set { ... } }`):
27
+
- Tokenizer must recognise `get`/`set` (and hook modifiers) in this context.
28
+
- Introduce AST nodes for hook lists/bodies that align with php-ast’s `AST_PROP_ELEM``hooks` child.
29
+
- Update diagnostics to catch invalid hook combinations.
30
+
-**Asymmetric visibility v2** (`public(set) private(get) $prop;`): extend the modifier grammar, update `TokenKind`, and cover tolerant AST flag handling.
31
+
-**`new Foo()->bar()` without wrapping parentheses**: confirm parser handles the reduced precedence and add regression tests.
32
+
-**Property hook improvements** (hook attributes, multiple hooks per property, etc.): ensure attribute placement and hook ordering are represented correctly.
33
+
- Audit additional 8.4 deprecations that change parsing (e.g. implicit nullable parameters) to ensure tolerant still emits matching diagnostics.
31
34
32
35
### PHP 8.5 (in progress)
33
36
34
37
Monitor RFCs merged into php-src and mirror the token/grammar changes, for example:
35
38
36
-
- Asymmetric property visibility.
37
-
- Additional keywords or attribute positions.
38
-
- New `T_*` tokens introduced in php-src; update `TokenKind.php` and `TokenStringMaps.php` accordingly.
39
+
-**Pipe operator** (`expr |> func(...)`): add new tokens, precedence rules, AST nodes, and fixtures.
40
+
-**`clone with`** expressions: model the new syntax (`clone $obj with { prop: value }`) and ensure node mapping covers the initializer list.
41
+
-**Final property promotion** (`final public function __construct(private final string $x) {}`): allow `final` in promoted parameters and carry flags into tolerant AST.
42
+
-**Attributes on constants / extended attribute targets**: verify attributes on constants and traits are preserved.
43
+
-**Extend `#[\Override]` to properties / `#[\NoDiscard]` / `#[\DelayedTargetValidation]`**: attributes already parse, but add regression coverage to ensure tolerant does not misclassify their targets.
44
+
- Track any additional keywords (`with`, operator tokens, etc.) and update `TokenKind.php` / `TokenStringMaps.php` accordingly.
39
45
40
46
### Diagnostics & Node Mapping
41
47
@@ -61,4 +67,3 @@ Monitor RFCs merged into php-src and mirror the token/grammar changes, for examp
61
67
3. Update diagnostics and tolerant AST converter expectations in tandem with Phan.
62
68
4. Refresh fixtures and CI to cover the new syntax.
63
69
5. Coordinate subtree sync back into Phan once tests pass.
0 commit comments