Merge tag 'v1.13.1' of https://github.com/ejmr/php-mode

Version 1.13.1
Merge tag 'v1.13.5'

Version 1.13.5
Don't highlight number as constant(#175)

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Add invalid constant name test

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Update the php-mode-modified date
Remove an unnecessary (require 'cl)

Because of commit 7f02722d we do not need a second (require 'cl).
This removal will cause the following warning when byte-compiling PHP
Mode…

    Warning: function `set-difference' from cl package called at
    runtime

…but the test suite still passes as expected and this warning seems to
cause no serious issue.

GitHub-Issue: 173
Add test for strings with escaped quotation marks

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Better configuration of multiline strings

cc-mode was configured to have escaped newlines in string literals and
to not have multiline strings, while it's actually the other way
around. This caused the opening " of a multiline string to get a
warning-face. I changed the test for issue-21 so it will fail in that
case. The test still passes because this commit fixes the issue.

The behaviour of escaped quotes as described in issue-174 is now
different, but not yet fixed.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Fix bad highlighting after escaped quotation mark

For keyword fontification to work we need backslashes as part of
words. But when doing syntactic fontification (comments and strings)
backslashes must have escape syntax.

I considered two ways of dealing with this:

1. Make \ word syntax by default and advice
`font-lock-fontify-syntactically-region' to temporarily set it to escape.

2. Make \ escape syntax by default and advice
`font-lock-fontify-keywords-region' to temporarily set it to word.

This commit implemented the second option so we don't change the
behaviour of forward-word compared to current stable php-mode.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Add missing language constructs to php-mode

A new test contains all language constructs and reserved keywords from
the PHP 5.6 manual. The test checks that they all get the
keyword-face. In addition to that, for keywords that preceed a type
identifier like instanceof and insteadof, it is checked that the
identifier gets the type-face.

Some keywords in c-other-kwds were already specified in another *-kwds,
those are now removed. Keywords added in this commit are: insteadof,
callable (the type hint now works just like 'array') and __halt_compiler().

This resolves issue #180.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Fix highlighting of "as" keyword and what follows

Add test case for issue #178.

The fix for "as" involves changing the order of patterns within
php-font-lock-keywords-3. Inline comments should make clear why it's
done this way and where to add new patterns. To summarize,
php-font-lock-keywords-3 is constructed out of three joined lists:

 1. php-mode patterns that apply faces before cc-mode patterns have the
    chance to apply a different face

 2. the actual detailed cc-mode patterns

 3. all other php-mode patterns, they only take effect if the matches are
    not already fontified

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>

Conflicts:
	php-mode-test.el
	php-mode.el
Cleanup c-offsets-alist for drupal and wordpress

Recent changes broke the indentation inside arglists for Drupal and
wordpress. Restoring the old situation by literally copying the old
offsets-alist is not an option for the following reasons:

 * we now inherit c-offsets-alist from the base-style (php), so we don't
   want to duplicate a different list for Drupal unless it actually needs
   completely different indentation rules.

 * old situation had bogus definitions: elements defined twice, elements
   defined to return default value or usage of `first' where the first
   defun always returns an offset.

 * old definitions contain rules not required by the standard, like 2
   spaces for case labels for wordpress. If some people need this
   behaviour we should document how to configure it, and if I'm mistaken
   it's easy to restore.

 * old definitions contain unclear rules like for K&R regions, if those
   do make sense in php-mode, I'd like to find out in what use case so
   we can test it.

Looking at the standards, there seems to be no need for
different indentation rules for drupal/wordpress/pear/psr2 so they now
all use the same c-offsets-alist.

Other changes in this commit:

 * c-offsets-alist is now alphabetically sorted
 * base style (php) now only defines elements that are actually
   different from the default

Ideas for future improvements related to coding styles:

 * there's no reason to show trailing whitespace by default for Drupal,
   and not other styles. Make this default to on or off and make it
   configurable, regardless of the used style.
 * same goes for automatic whitespace removal, this makes as much sense
   for PSR2 as it does for Drupal.
 * this also applies to the lineup-cascaded calls behaviour and to
   lesser extent hanging semicolons, no style guide specifies how to
   lineup chained methods, so it makes no sense to have it enabled for
   psr2 and (for example) disabled for pear (it's currently on for all
   styles but the user can disable it by changing the c-offsets-alist -
   which is probably hard to figure out how to do for many users)
 * remove symfony2 style (psr2 should suffice)
 * better documentation (issue #131)

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Fix switch indentation with multiple cases

This fixes issue #186 where indentation was incorrect for statements
following multiple case labels that switch on true/false/null or strings
delimited by double quotes.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Disallow visibility keywords in colon labels

Trivial change; a construct like 'public:' does not exist in PHP, so
don't explicitly allow it in c-nonlabel-token-key.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
Update PHP Mode for version 1.15.0

Special thanks to Joris Steyn, whose patches are single-handedly
responsible for this release.
Merge tag 'v1.15.0'

Version 1.15.0