Skip to content

Commit

Permalink
Remove R regex parser
Browse files Browse the repository at this point in the history
Unused by us, not present in uctags.
  • Loading branch information
techee committed Aug 7, 2016
1 parent 2671d73 commit 1d48599
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions ctags/parsers/r.c
Expand Up @@ -23,12 +23,10 @@
#include "vstring.h"
#include "routines.h"

/*#define R_REGEX*/

#define SKIPSPACE(ch) while (isspace((int)*ch)) \
ch++

#ifndef R_REGEX
typedef enum {
K_FUNCTION,
K_LIBRARY,
Expand All @@ -41,23 +39,7 @@ static kindOption RKinds [KIND_COUNT] = {
{TRUE, 'l', "library", "libraries"},
{TRUE, 's', "source", "sources"},
};
#endif

#ifdef R_REGEX
static void installRRegex (const langType language)
{
/* This is a function, looks as follows:
* itent <- function(arg1, arg2) {
* do_something;
* }
*/
addTagRegex (language,
"^[ \t]*([.a-zA-Z0-9_]+)([ \t]*)<-([ \t]*)function", "\\1", "f,function", NULL);
/* This loads someting, e.g. a library, simply: library(libname) */
addTagRegex (language,
"^[ \t]*(library|source|load|data)[\\(]([a-zA-Z0-9_]+)[\\)]", "\\2", "s,other", NULL);
}
#else
static void makeRTag (const vString * const name, rKind kind)
{
tagEntryInfo e;
Expand Down Expand Up @@ -179,7 +161,6 @@ static void createRTags (void)
vStringDelete (name);
vStringDelete (vLine);
}
#endif

extern parserDefinition *RParser (void)
{
Expand All @@ -188,17 +169,10 @@ extern parserDefinition *RParser (void)
*/
static const char *const extensions [] = { "r", "s", "q", NULL };
parserDefinition *const def = parserNew ("R");
#ifndef R_REGEX
def->kinds = RKinds;
def->kindCount = ARRAY_SIZE (RKinds);
#endif
def->extensions = extensions;
#ifndef R_REGEX
def->parser = createRTags;
#else
def->initialize = installRRegex;
def->regex = TRUE;
#endif
return def;
}

Expand Down

0 comments on commit 1d48599

Please sign in to comment.