From: "Avery Pennarun" <apenwarr@gmail.com>
To: <gitster@pobox.com>, <git@vger.kernel.org>, <pasky@suse.cz>
Cc: "Avery Pennarun" <apenwarr@gmail.com>
Subject: [PATCH] Add Pascal/Delphi (.pas file) funcname pattern.
Date: Fri, 1 Aug 2008 17:00:15 -0400 [thread overview]
Message-ID: <1217624415-14736-1-git-send-email-apenwarr@gmail.com> (raw)
Finds classes, records, functions, procedures, and sections. Most lines
need to start at the first column, or else there's no way to differentiate
a procedure's definition from its declaration.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
---
diff.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
Changes since v1:
- Tried using '\n' to separate the two parts of the regex, but it doesn't
work. Seems the lines are combined with AND instead of OR. Also can't
reduce the number of parens since only the part in parens is returned
as the result string.
- Rename 'pas' type to 'pascal'
- Remove unnecessary 'type' match.
diff --git a/diff.c b/diff.c
index cbf2547..2f88e6d 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,6 +1380,12 @@ static struct builtin_funcname_pattern {
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*\\)$" },
+ { "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
+ "destructor\\|interface\\|implementation\\|"
+ "initialization\\|finalization\\)[ \t]*.*\\)$"
+ "\\|"
+ "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
+ },
{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
};
--
1.5.6
next reply other threads:[~2008-08-01 21:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 21:00 Avery Pennarun [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-08-01 19:45 [PATCH] Add Pascal/Delphi (.pas file) funcname pattern Avery Pennarun
2008-08-01 20:16 ` Junio C Hamano
2008-08-01 20:38 ` Avery Pennarun
2008-08-01 20:20 ` Petr Baudis
2008-08-01 20:40 ` Avery Pennarun
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=1217624415-14736-1-git-send-email-apenwarr@gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pasky@suse.cz \
/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 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 NNTP newsgroup(s).