{"thread":{"id":"14795","subject":"[PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","startedAt":"2008-08-01T19:45:15Z","lastAt":"2008-08-01T20:40:49Z","messageCount":5,"participants":["Avery Pennarun","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"85917","messageId":"1217619915-9331-1-git-send-email-apenwarr@gmail.com","threadId":"14795","inReplyTo":null,"subject":"[PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-08-01T19:45:15Z","receivedAt":"2008-08-01T19:45:15Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"Finds classes, records, functions, procedures, and sections.  Most lines\nneed to start at the first column, or else there's no way to differentiate\na procedure's definition from its declaration.\n\nSigned-off-by: Avery Pennarun <apenwarr@gmail.com>\n---\n\nThe Ruby funcname pattern patch inspired me.  Although unlike him, I didn't\ncheck with anyone else for confirmation.  How many Pascal programmers can\nthere possibly be? :)\n\n diff.c |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex cbf2547..c73ba69 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1380,6 +1380,10 @@ static struct builtin_funcname_pattern {\n \t\t\t\"^[ \t]*\\\\(\\\\([ \t]*\"\n \t\t\t\"[A-Za-z_][A-Za-z_0-9]*\\\\)\\\\{2,\\\\}\"\n \t\t\t\"[ \t]*([^;]*\\\\)$\" },\n+\t{ \"pas\", \"\\\\(^\\\\(procedure\\\\|function\\\\|constructor\\\\|\"\n+\t\t\t\"destructor\\\\|interface\\\\|implementation\\\\|\"\n+\t\t\t\"type|initialization|finalization\\\\).*$\\\\)\"\n+\t\t\t\"\\\\|\\\\(^.*=[ \\t]*\\\\(class\\\\|record\\\\).*$\\\\)\" },\n \t{ \"tex\", \"^\\\\(\\\\\\\\\\\\(sub\\\\)*section{.*\\\\)$\" },\n };\n \n-- \n1.6.0.rc1.34.g23b24.dirty\n"},{"id":"85921","messageId":"7v8wvgsd6s.fsf@gitster.siamese.dyndns.org","threadId":"14795","inReplyTo":"1217619915-9331-1-git-send-email-apenwarr@gmail.com","subject":"Re: [PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-01T20:16:59Z","receivedAt":"2008-08-01T20:16:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> Finds classes, records, functions, procedures, and sections.  Most lines\n> need to start at the first column, or else there's no way to differentiate\n> a procedure's definition from its declaration.\n>\n> Signed-off-by: Avery Pennarun <apenwarr@gmail.com>\n> ---\n>\n> The Ruby funcname pattern patch inspired me.  Although unlike him, I didn't\n> check with anyone else for confirmation.  How many Pascal programmers can\n> there possibly be? :)\n\n> +\t{ \"pas\", \"\\\\(^\\\\(procedure\\\\|function\\\\|constructor\\\\|\"\n> +\t\t\t\"destructor\\\\|interface\\\\|implementation\\\\|\"\n> +\t\t\t\"type|initialization|finalization\\\\).*$\\\\)\"\n> +\t\t\t\"\\\\|\\\\(^.*=[ \\t]*\\\\(class\\\\|record\\\\).*$\\\\)\" },\n\nIs Delphi the only surviving Pascal?  Why is the name \"pas\", not \"pascal\"\nor even \"delphi-pascal\"?\n\nThe keys are not file extensions (\"ruby\" example did the right thing by\nnot saying \"rb\").\n"},{"id":"85923","messageId":"20080801202059.GS32184@machine.or.cz","threadId":"14795","inReplyTo":"1217619915-9331-1-git-send-email-apenwarr@gmail.com","subject":"Re: [PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-01T20:20:59Z","receivedAt":"2008-08-01T20:20:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Fri, Aug 01, 2008 at 03:45:15PM -0400, Avery Pennarun wrote:\n> diff --git a/diff.c b/diff.c\n> index cbf2547..c73ba69 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -1380,6 +1380,10 @@ static struct builtin_funcname_pattern {\n>  \t\t\t\"^[ \t]*\\\\(\\\\([ \t]*\"\n>  \t\t\t\"[A-Za-z_][A-Za-z_0-9]*\\\\)\\\\{2,\\\\}\"\n>  \t\t\t\"[ \t]*([^;]*\\\\)$\" },\n> +\t{ \"pas\", \"\\\\(^\\\\(procedure\\\\|function\\\\|constructor\\\\|\"\n> +\t\t\t\"destructor\\\\|interface\\\\|implementation\\\\|\"\n> +\t\t\t\"type|initialization|finalization\\\\).*$\\\\)\"\n> +\t\t\t\"\\\\|\\\\(^.*=[ \\t]*\\\\(class\\\\|record\\\\).*$\\\\)\" },\n>  \t{ \"tex\", \"^\\\\(\\\\\\\\\\\\(sub\\\\)*section{.*\\\\)$\" },\n>  };\n>  \n\nWouldn't it be better to make the second pattern start on new line\ninstead of the outer \\(\\|\\)?\n\nWhy \"type\"?\n\n-- \n\t\tPetr \"Pasky, but not writing in Pascal anymore!\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"85927","messageId":"32541b130808011338t17a45e51sd0df245dc456b087@mail.gmail.com","threadId":"14795","inReplyTo":"7v8wvgsd6s.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-08-01T20:38:43Z","receivedAt":"2008-08-01T20:38:43Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 8/1/08, Junio C Hamano <gitster@pobox.com> wrote:\n> Is Delphi the only surviving Pascal?  Why is the name \"pas\", not \"pascal\"\n>  or even \"delphi-pascal\"?\n\nNo, but all surviving Pascals pretty much support the same syntax, so\nwhen I say Pascal/Delphi, I mean either one.  And Delphi does use the\n.pas extension.\n\n>  The keys are not file extensions (\"ruby\" example did the right thing by\n>  not saying \"rb\").\n\nWill fix.\n\nAvery\n"},{"id":"85929","messageId":"32541b130808011340j38715970k8dda59fc01ce6918@mail.gmail.com","threadId":"14795","inReplyTo":"20080801202059.GS32184@machine.or.cz","subject":"Re: [PATCH] Add Pascal/Delphi (.pas file) funcname pattern.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-08-01T20:40:49Z","receivedAt":"2008-08-01T20:40:49Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 8/1/08, Petr Baudis <pasky@suse.cz> wrote:\n> On Fri, Aug 01, 2008 at 03:45:15PM -0400, Avery Pennarun wrote:\n>  > +     { \"pas\", \"\\\\(^\\\\(procedure\\\\|function\\\\|constructor\\\\|\"\n>  > +                     \"destructor\\\\|interface\\\\|implementation\\\\|\"\n>  > +                     \"type|initialization|finalization\\\\).*$\\\\)\"\n>  > +                     \"\\\\|\\\\(^.*=[ \\t]*\\\\(class\\\\|record\\\\).*$\\\\)\" },\n>\n> Wouldn't it be better to make the second pattern start on new line\n>  instead of the outer \\(\\|\\)?\n\nI didn't even know that was possible, but suddenly I understand the\n\"java\" pattern a lot better.  Thanks!\n\n>  Why \"type\"?\n\nWell, it's a subsection, but it's always followed by a class or record\ndefinition anyway, so I guess it makes more sense to omit it, now that\nyou bring it up.\n\nHave fun,\n\nAvery\n"}]}