userdiff: support new keywords in PHP hunk header
Recent version of PHP supports interface, trait, abstract class and final class. This patch fixes the PHP hunk header regexp to support all of these keywords. Signed-off-by: Kana Natsuno <dev@whileimautomaton.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9992fbd7a1
commit
1ab631647e
|
@ -0,0 +1,4 @@
|
|||
abstract class RIGHT
|
||||
{
|
||||
const FOO = 'ChangeMe';
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
final class RIGHT
|
||||
{
|
||||
const FOO = 'ChangeMe';
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
interface RIGHT
|
||||
{
|
||||
public function foo($ChangeMe);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
trait RIGHT
|
||||
{
|
||||
public function foo($ChangeMe)
|
||||
{
|
||||
return 'foo';
|
||||
}
|
||||
}
|
|
@ -114,7 +114,7 @@ PATTERNS("perl",
|
|||
"|<<|<>|<=>|>>"),
|
||||
PATTERNS("php",
|
||||
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
|
||||
"^[\t ]*(class.*)$",
|
||||
"^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
|
||||
/* -- */
|
||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
|
||||
|
|
Loading…
Reference in New Issue