Commit 7da776b
committed
Add php-indent.el, a CC Mode-free indentation engine ported from js.el
Extracted from the cc-mode independent php-mode work (#812) so that it
can be reviewed and land independently of the Emacs 28.1 requirement
that blocks that branch until the August release (#811).
The engine is ported from the syntax-ppss based indenter of js.el in GNU
Emacs (attributed in the file header); the JavaScript specific handling
(JSX, C preprocessor macros, array comprehensions and regexp literals)
is removed, and PHP specifics are added: -> / ?-> / :: method and
property chains, the . concatenation operator aligned to the assignment,
statement continuations, switch/case, the alternative syntax (endif and
friends) and heredoc/nowdoc bodies. Its entry points are php-indent-line
and php-indent-region.
The file is self-contained: it only requires php.el for the php
customization group, and defines no symbol that collides with the
current php-mode.
This is purely additive: nothing sets php-indent-line as
indent-line-function yet, so the engine is inert -- the current CC Mode
based php-mode keeps indenting through cc-engine. Registering both new
files in Eask so they are byte-compiled by CI.1 parent fca743a commit 7da776b
2 files changed
Lines changed: 713 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
0 commit comments