From 9432553ca102bcb2cd5b6692ef993c912cdaa0ef Mon Sep 17 00:00:00 2001 From: Vitor Antunes Date: Wed, 9 Sep 2015 20:54:38 +0100 Subject: [PATCH] r: Include .R as a valid R language file extension --- Units/parser-r.r/r-uppercase-extension.d/expected.tags | 3 +++ Units/parser-r.r/r-uppercase-extension.d/input.R | 7 +++++++ parsers/r.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Units/parser-r.r/r-uppercase-extension.d/expected.tags create mode 100644 Units/parser-r.r/r-uppercase-extension.d/input.R diff --git a/Units/parser-r.r/r-uppercase-extension.d/expected.tags b/Units/parser-r.r/r-uppercase-extension.d/expected.tags new file mode 100644 index 0000000000..35c0264baf --- /dev/null +++ b/Units/parser-r.r/r-uppercase-extension.d/expected.tags @@ -0,0 +1,3 @@ +foo input.R /^foo <- function () {$/;" f +x input.R /^x <- 1$/;" g +y input.R /^ y <- 2$/;" v diff --git a/Units/parser-r.r/r-uppercase-extension.d/input.R b/Units/parser-r.r/r-uppercase-extension.d/input.R new file mode 100644 index 0000000000..2ee90a7d67 --- /dev/null +++ b/Units/parser-r.r/r-uppercase-extension.d/input.R @@ -0,0 +1,7 @@ +# Copuied from: +# http://stackoverflow.com/questions/32206608/ctags-and-r-regex +x <- 1 +foo <- function () { + y <- 2 + return(y) +} diff --git a/parsers/r.c b/parsers/r.c index a862a6a5b8..1e8316a27a 100644 --- a/parsers/r.c +++ b/parsers/r.c @@ -200,10 +200,10 @@ static void createRTags (void) extern parserDefinition *RParser (void) { - /* *.r: R files + /* *.r;*.R: R files * *.s;*.q: S files */ - static const char *const extensions[] = { "r", "s", "q", NULL }; + static const char *const extensions[] = { "r", "R", "s", "q", NULL }; parserDefinition *const def = parserNew ("R"); def->extensions = extensions; def->kinds = RKinds;