git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] userdiff: support enum keyword in PHP hunk header
@ 2021-08-31  6:01 USAMI Kenta via GitGitGadget
  2021-08-31 19:15 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: USAMI Kenta via GitGitGadget @ 2021-08-31  6:01 UTC (permalink / raw)
  To: git; +Cc: USAMI Kenta, USAMI Kenta

From: USAMI Kenta <tadsan@zonu.me>

"enum" keyword will be introduced in PHP 8.1.
https://wiki.php.net/rfc/enumerations

Signed-off-by: USAMI Kenta <tadsan@zonu.me>
---
    userdiff: support enum keyword in PHP hunk header
    
    "enum" keyword will be introduced in PHP 8.1.
    https://wiki.php.net/rfc/enumerations

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1082%2Fzonuexe%2Ffeature%2Fuserdiff-php-enum-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1082/zonuexe/feature/userdiff-php-enum-v1
Pull-Request: https://github.com/git/git/pull/1082

 t/t4018/php-enum | 4 ++++
 userdiff.c       | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 t/t4018/php-enum

diff --git a/t/t4018/php-enum b/t/t4018/php-enum
new file mode 100644
index 00000000000..91a69c1a2bc
--- /dev/null
+++ b/t/t4018/php-enum
@@ -0,0 +1,4 @@
+enum RIGHT: string
+{
+    case Foo = 'ChangeMe';
+}
diff --git a/userdiff.c b/userdiff.c
index d9b2ba752f0..d9ec484d535 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -214,7 +214,7 @@ PATTERNS("perl",
 	 "|<<|<>|<=>|>>"),
 PATTERNS("php",
 	 "^[\t ]*(((public|protected|private|static|abstract|final)[\t ]+)*function.*)$\n"
-	 "^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
+	 "^[\t ]*((((final|abstract)[\t ]+)?class|enum|interface|trait).*)$",
 	 /* -- */
 	 "[a-zA-Z_][a-zA-Z0-9_]*"
 	 "|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"

base-commit: c4203212e360b25a1c69467b5a8437d45a373cac
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] userdiff: support enum keyword in PHP hunk header
  2021-08-31  6:01 [PATCH] userdiff: support enum keyword in PHP hunk header USAMI Kenta via GitGitGadget
@ 2021-08-31 19:15 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2021-08-31 19:15 UTC (permalink / raw)
  To: USAMI Kenta via GitGitGadget; +Cc: git, USAMI Kenta

"USAMI Kenta via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: USAMI Kenta <tadsan@zonu.me>
>
> "enum" keyword will be introduced in PHP 8.1.
> https://wiki.php.net/rfc/enumerations
>
> Signed-off-by: USAMI Kenta <tadsan@zonu.me>
> ---
>     userdiff: support enum keyword in PHP hunk header
>     
>     "enum" keyword will be introduced in PHP 8.1.
>     https://wiki.php.net/rfc/enumerations

I no longer speak PHP, but this looks sensible to me.

Thanks, will queue.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-31 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31  6:01 [PATCH] userdiff: support enum keyword in PHP hunk header USAMI Kenta via GitGitGadget
2021-08-31 19:15 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).