From: "USAMI Kenta via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: USAMI Kenta <tadsan@zonu.me>, USAMI Kenta <tadsan@zonu.me>
Subject: [PATCH] userdiff: support enum keyword in PHP hunk header
Date: Tue, 31 Aug 2021 06:01:25 +0000 [thread overview]
Message-ID: <pull.1082.git.git.1630389685997.gitgitgadget@gmail.com> (raw)
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
next reply other threads:[~2021-08-31 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 6:01 USAMI Kenta via GitGitGadget [this message]
2021-08-31 19:15 ` [PATCH] userdiff: support enum keyword in PHP hunk header Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1082.git.git.1630389685997.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=tadsan@zonu.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.