Skip to content

Preserve documentation and hook string semantics#262

Draft
sirreal wants to merge 7 commits into
masterfrom
fix-254
Draft

Preserve documentation and hook string semantics#262
sirreal wants to merge 7 commits into
masterfrom
fix-254

Conversation

@sirreal

@sirreal sirreal commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes #254.

What changed

  • Stop applying namespace cleanup to every exported string.
  • Normalize AST names at expression and metadata boundaries, preserving established JSON for defaults, constants, references, and call metadata.
  • Export literal hook names with PHP string semantics.

Why

The PHP-Parser 5 compatibility cleanup treated documentation and hook literals as identifiers. It removed meaningful backslashes. Simply deleting that cleanup also caused broad JSON churn such as false becoming \false.

Keep syntax normalization where it belongs. Leave text alone.

Testing

  • npm run test:phpunit — 28 tests, 158 assertions; 11 pre-existing PHPUnit deprecation warnings.
  • php tests/prep-diff-test.php
  • Full wp-includes export: expected documentation escapes remain; no stray global prefixes in defaults, constant values, references, or call-class metadata.

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.

Some characters are stripped from documentation

1 participant