[PATCH 4/4 v2] diff.c: convert builtin funcname patterns to extended regular expressions
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Sep 18, 2008, 00:33 UTC
- Message-ID
- <GDyYcKTaBR3x9PvTNoIdz93Z3xMLyTRKkKzkucPv-qhrm-KS_3c0QA@cipher.nrlssc.navy.mil>
- In-Reply-To
- <-f-gqL4SkA8Uh7hSuKT-JDY0g26jHn3fDQCE24MB1nKWUMLZWuSseg@cipher.nrlssc.navy.mil>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> ---
The original version changed the cflags parameter from '0' to '1' rather than to the macro REG_EXTENDED as it should have been.
This version is corrected.
-brandon
diff.c | 35 ++++++++++++++++++----------------- 1 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/diff.c b/diff.c index ad5e551..8018544 100644 --- a/diff.c +++ b/diff.c @@ -1401,23 +1401,24 @@ static struct funcname_pattern_entry { const char *pattern; const int cflags; } builtin_funcname_pattern[] = { - { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$", 0 }, - { "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$", 0 }, - { "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|" - "new\\|return\\|switch\\|throw\\|while\\)\n" - "^[ ]*\\(\\([ ]*" - "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}" - "[ ]*([^;]*\\)$", 0 }, - { "pascal", "^\\(\\(procedure\\|function\\|constructor\\|" - "destructor\\|interface\\|implementation\\|" - "initialization\\|finalization\\)[ \t]*.*\\)$" - "\\|" - "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$", - 0 }, - { "php", "^[\t ]*\\(\\(function\\|class\\).*\\)", 0 }, - { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$", 0 }, - { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$", 0 }, - { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$", 0 }, + { "bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#\\}\\{~%]*).*$", REG_EXTENDED }, + { "html", "^\\s*(<[Hh][1-6]\\s.*>.*)$", REG_EXTENDED }, + { "java", "!^[ ]*(catch|do|for|if|instanceof|" + "new|return|switch|throw|while)\n" + "^[ ]*(([ ]*" + "[A-Za-z_][A-Za-z_0-9]*){2,}" + "[ ]*\\([^;]*)$", REG_EXTENDED }, + { "pascal", "^((procedure|function|constructor|" + "destructor|interface|implementation|" + "initialization|finalization)[ \t]*.*)$" + "|" + "^(.*=[ \t]*(class|record).*)$", + REG_EXTENDED }, + { "php", "^[\t ]*((function|class).*)", REG_EXTENDED }, + { "python", "^\\s*((class|def)\\s.*)$", REG_EXTENDED }, + { "ruby", "^\\s*((class|module|def)\\s.*)$", REG_EXTENDED }, + { "tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$", + REG_EXTENDED }, }; static const struct funcname_pattern_entry *funcname_pattern(const char *ident)
-- 1.6.0.1.244.gdc19