summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 276328f)
raw | patch | inline | side by side (parent: 276328f)
author | Jonathan del Strother <jon.delStrother@bestbefore.tv> | |
Tue, 30 Sep 2008 23:46:34 +0000 (00:46 +0100) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 6 Oct 2008 16:02:47 +0000 (09:02 -0700) |
Add support for recognition of Objective-C class & instance methods,
C functions, and class implementation/interfaces.
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
C functions, and class implementation/interfaces.
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Documentation/gitattributes.txt | patch | blob | history | |
diff.c | patch | blob | history |
index 2ae771f2fb213a478cf8ed5273829c97ad1392a9..26945593cb1739bb6a6e1e2acc2cd78caab3a102 100644 (file)
- `java` suitable for source code in the Java language.
+- `objc` suitable for source code in the Objective-C language.
+
- `pascal` suitable for source code in the Pascal/Delphi language.
- `php` suitable for source code in the PHP language.
index 02e948c9dd6244a0003c2c6bc81f55e46cf0ad2b..2af3a974872e3bafeead339503a0d1eab051779d 100644 (file)
--- a/diff.c
+++ b/diff.c
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
"^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$",
REG_EXTENDED },
+ { "objc",
+ /* Negate C statements that can look like functions */
+ "!^[ \t]*(do|for|if|else|return|switch|while)\n"
+ /* Objective-C methods */
+ "^[ \t]*([-+][ \t]*\\([ \t]*[A-Za-z_][A-Za-z_0-9* \t]*\\)[ \t]*[A-Za-z_].*)$\n"
+ /* C functions */
+ "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$\n"
+ /* Objective-C class/protocol definitions */
+ "^(@(implementation|interface|protocol)[ \t].*)$",
+ REG_EXTENDED },
{ "pascal",
"^((procedure|function|constructor|destructor|interface|"
"implementation|initialization|finalization)[ \t]*.*)$"