Move php-magical-constants to php-keywords.el#819
Merged
Conversation
php-keywords.el calls itself "a single source of truth for PHP keywords", but php.el kept a vocabulary list of its own under a ";;; PHP Keywords" heading, so a reader asking where PHP's keywords live got two answers. Move the list to the module that owns the vocabulary. The name does not change. php-magical-constants is a long-standing public symbol and both major modes build their php-magical-constant font-lock rule straight from it; keeping it is also what php-core.el does for php-executable and php-base-mode, so no alias is needed and no caller has to move. php.el requires php-keywords.el and therefore still exposes it -- (require 'php) behaves exactly as before. php-keywords.el still requires nothing, so the dependency arrow keeps pointing the natural way. php-re-token-symbols stays in php.el: its only consumer is php.el's own token scanner, and it has no list form to fit this file's NAME / NAME-re convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the php.el decomposition. Small and self-contained.
Why
php-keywords.el calls itself "a single source of truth for PHP keywords", but php.el kept a vocabulary list of its own under a
;;; PHP Keywordsheading — so a reader asking where PHP's keywords live got two answers. This moves the list to the module that owns the vocabulary, which makes that claim true.The name does not change
php-magical-constantsstaysphp-magical-constants. It is a long-standing public symbol and both major modes build theirphp-magical-constantfont-lock rule straight from it. Keeping the name is also exactly what #815 did — php-core.el holdsphp-executable,php-in-string-pandphp-base-modeunder their own names — so:(require 'php)behaves exactly as before, because php.el requires php-keywords.el and therefore still exposes it.(An earlier sketch had this renamed to
php-keywords-magic-constantswith an alias. Dropped — it bought nothing and would have made the file's naming more mixed, since everything else there isphp-keywords--*.)Verification
defconstis moved byte-for-byte;diffagainst master confirms it is identical.(require 'php),php-magical-constantsstill holds the same 8 constants.Not moved
php-re-token-symbolsstays in php.el. Its only consumer is php.el's own token scanner, and it is a bare regexp with no list form, so it does not fit this file'sNAME/NAME-reconvention.