Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Wed, 12 Oct 2016 15:32:01 UTC Commit: ca19e6e3b3a6c65e5ab00c488ad9bf94343029c7 https://github.com/geany/geany/commit/ca19e6e3b3a6c65e5ab00c488ad9bf94343029...
Log Message: ----------- lregex: sync some function prototypes
Modified Paths: -------------- ctags/main/lregex.c ctags/main/parse.c ctags/main/parse.h
Modified: ctags/main/lregex.c 43 lines changed, 30 insertions(+), 13 deletions(-) =================================================================== @@ -137,7 +137,7 @@ static void clearPatternSet (const langType language) * Regex pseudo-parser */
-static void makeRegexTag ( +static int makeRegexTag ( const vString* const name, const kindOption* const kind) { Assert (kind != NULL); @@ -146,8 +146,10 @@ static void makeRegexTag ( tagEntryInfo e; Assert (name != NULL && vStringLength (name) > 0); initTagEntry (&e, vStringValue (name), kind); - makeTagEntry (&e); + return makeTagEntry (&e); } + else + return CORK_NIL; }
/* @@ -325,7 +327,8 @@ static regexPattern* addCompiledTagCommon (const langType language,
static regexPattern *addCompiledTagPattern (const langType language, GRegex* const pattern, const char* const name, char kind, const char* kindName, - char *const description) + char *const description, const char* flags, + bool *disabled) { regexPattern * ptrn; bool exclusive = false; @@ -360,7 +363,9 @@ static regexPattern *addCompiledTagPattern (const langType language, GRegex* con }
static void addCompiledCallbackPattern (const langType language, GRegex* const pattern, - const regexCallback callback) + const regexCallback callback, const char* flags, + bool *disabled, + void *userData) { regexPattern * ptrn; bool exclusive = false; @@ -531,7 +536,8 @@ static void matchCallbackPattern ( if (so != -1) count = i + 1; } - patbuf->u.callback.function (vStringValue (line), matches, count); + patbuf->u.callback.function (vStringValue (line), matches, count, + patbuf->u.callback.userData); }
static bool matchRegexPattern (const vString* const line, @@ -588,7 +594,8 @@ static regexPattern *addTagRegexInternal (const langType language, const char* const regex, const char* const name, const char* const kinds, - const char* const flags) + const char* const flags, + bool *disabled) { regexPattern *rptr = NULL; Assert (regex != NULL); @@ -601,6 +608,7 @@ static regexPattern *addTagRegexInternal (const langType language, char kind; char* kindName; char* description; + parseKinds (kinds, &kind, &kindName, &description); if (kind == getLanguageFileKind (language)->letter) error (FATAL, @@ -610,7 +618,8 @@ static regexPattern *addTagRegexInternal (const langType language, getLanguageName (language));
rptr = addCompiledTagPattern (language, cp, name, - kind, kindName, description); + kind, kindName, description, flags, + disabled); if (kindName) eFree (kindName); if (description) @@ -620,7 +629,10 @@ static regexPattern *addTagRegexInternal (const langType language,
if (*name == '\0') { - error (WARNING, "%s: regexp missing name pattern", regex); + if (rptr->exclusive || rptr->scopeActions & SCOPE_PLACEHOLDER) + rptr->accept_empty_name = true; + else + error (WARNING, "%s: regexp missing name pattern", regex); }
return rptr; @@ -630,22 +642,26 @@ extern void addTagRegex (const langType language CTAGS_ATTR_UNUSED, const char* const regex CTAGS_ATTR_UNUSED, const char* const name CTAGS_ATTR_UNUSED, const char* const kinds CTAGS_ATTR_UNUSED, - const char* const flags CTAGS_ATTR_UNUSED) + const char* const flags CTAGS_ATTR_UNUSED, + bool *disabled) { - addTagRegexInternal (language, regex, name, kinds, flags); + addTagRegexInternal (language, regex, name, kinds, flags, disabled); }
extern void addCallbackRegex (const langType language CTAGS_ATTR_UNUSED, const char* const regex CTAGS_ATTR_UNUSED, const char* const flags CTAGS_ATTR_UNUSED, - const regexCallback callback CTAGS_ATTR_UNUSED) + const regexCallback callback CTAGS_ATTR_UNUSED, + bool *disabled, + void * userData) { Assert (regex != NULL); if (regexAvailable) { GRegex* const cp = compileRegex (regex, flags); if (cp != NULL) - addCompiledCallbackPattern (language, cp, callback); + addCompiledCallbackPattern (language, cp, callback, flags, + disabled, userData); } }
@@ -658,7 +674,8 @@ extern void addLanguageRegex ( char *name, *kinds, *flags; if (parseTagRegex (regex_pat, &name, &kinds, &flags)) { - addTagRegexInternal (language, regex_pat, name, kinds, flags); + addTagRegexInternal (language, regex_pat, name, kinds, flags, + NULL); eFree (regex_pat); } }
Modified: ctags/main/parse.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -437,7 +437,8 @@ static void installTagRegexTable (const langType language) lang->tagRegexTable [i].regex, lang->tagRegexTable [i].name, lang->tagRegexTable [i].kinds, - lang->tagRegexTable [i].flags); + lang->tagRegexTable [i].flags, + (lang->tagRegexTable [i].disabled)); } }
Modified: ctags/main/parse.h 10 lines changed, 7 insertions(+), 3 deletions(-) =================================================================== @@ -92,7 +92,8 @@ typedef struct { size_t length; /* length of match */ } regexMatch;
-typedef void (*regexCallback) (const char *line, const regexMatch *matches, unsigned int count); +typedef void (*regexCallback) (const char *line, const regexMatch *matches, unsigned int count, + void *userData);
typedef enum { LMAP_PATTERN = 1 << 0, @@ -143,8 +144,11 @@ extern void findRegexTags (void); extern bool matchRegex (const vString* const line, const langType language); extern bool processRegexOption (const char *const option, const char *const parameter); extern void addLanguageRegex (const langType language, const char* const regex); -extern void addTagRegex (const langType language, const char* const regex, const char* const name, const char* const kinds, const char* const flags); -extern void addCallbackRegex (const langType language, const char* const regex, const char* flags, const regexCallback callback); +extern void addTagRegex (const langType language, const char* const regex, + const char* const name, const char* const kinds, const char* const flags, + bool *disabled); +extern void addCallbackRegex (const langType language, const char *const regexo, const char *const flags, + const regexCallback callback, bool *disabled, void *userData); extern void freeRegexResources (void); extern bool checkRegex (void);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).