php-mode icon indicating copy to clipboard operation
php-mode copied to clipboard

c-type-list-kwds instances inside strings are fontified

Open phil-s opened this issue 6 years ago • 1 comments

e.g. my PHP file contains $foo = 'Title to use when rendering.'; and the word when is highlighted, because it is being treated as the <thing> in a use <thing> declaration.

I expect the relevant code is:

(c-lang-defconst c-type-list-kwds
  php '("new" "use" "implements" "extends" "namespace" "instanceof" "insteadof"))

A bit of experimenting suggests that such things only occur for c-type-list-kwds and potentially c-postfix-decl-spec-kwds (which is a subset of the former), but do not happen for the other uses of c-lang-defconst.

Is this just Expected Behaviour from the parent mode, or can php-mode do something to prevent such keywords being fontified inside strings?

I notice that this does not happen inside comments.

phil-s avatar Jan 07 '19 01:01 phil-s

@phil-s Thank you for reporting.

zonuexe avatar Jan 09 '19 12:01 zonuexe