Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync our ctags to the latest tag version (p6.1.20240421.0) #3859

Merged
merged 16 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ctags/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ parsers = \
parsers/make.h \
parsers/markdown.c \
parsers/markdown.h \
parsers/geany_matlab.c \
parsers/matlab.c \
parsers/nsis.c \
parsers/objc.c \
parsers/ocaml.c \
Expand Down
2 changes: 1 addition & 1 deletion ctags/main/repoinfo.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define CTAGS_REPOINFO "p6.0.20231001.0"
#define CTAGS_REPOINFO "p6.1.20240421.0"
150 changes: 0 additions & 150 deletions ctags/parsers/geany_matlab.c

This file was deleted.

53 changes: 53 additions & 0 deletions ctags/parsers/matlab.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2008, David Fishburn
*
* This source code is released for free distribution under the terms of the
* GNU General Public License version 2 or (at your option) any later version.
*
* This module contains functions for generating tags for MATLAB language files.
*/

/*
* INCLUDE FILES
*/
#include "general.h" /* must always come first */

#include <string.h>
#include "parse.h"
#include "routines.h"
#include "selectors.h"

static tagRegexTable matlabTagRegexTable [] = {
/* function [x,y,z] = asdf */
{ "^[ \t]*function[ \t]*\\[.*\\][ \t]*=[ \t]*([.a-zA-Z0-9_]+)",
"\\1", "f,function", NULL},
/* function x = asdf */
{"^[ \t]*function[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*([.a-zA-Z0-9_]+)",
"\\1", "f,function", NULL},
/* function asdf */
{"^[ \t]*function[ \t]*([.a-zA-Z0-9_]+)[^=]*$", "\\1",
"f,function", NULL},
/* variables */
{"^[ \t]*([a-zA-Z0-9_]+)[ \t]*=[ \t]", "\\1",
"v,variable", NULL},
/* class definitions */
{"^[ \t]*classdef[ \t]*([a-zA-Z0-9_]+)", "\\1",
"c,class", NULL},
};

/*
* FUNCTION DEFINITIONS
*/
extern parserDefinition* MatLabParser (void)
{
static const char *const extensions [] = { "m", NULL };
static selectLanguage selectors [] = { selectByObjectiveCAndMatLabKeywords,
NULL };
parserDefinition* const def = parserNew ("MatLab");
def->extensions = extensions;
def->tagRegexTable = matlabTagRegexTable;
def->tagRegexCount = ARRAY_SIZE (matlabTagRegexTable);
def->method = METHOD_NOT_CRAFTED|METHOD_REGEX;
def->selectLanguage = selectors;
return def;
}
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ ctags = static_library('ctags',
'ctags/parsers/geany_docbook.c',
'ctags/parsers/geany_lcpp.c',
'ctags/parsers/geany_lcpp.h',
'ctags/parsers/geany_matlab.c',
'ctags/parsers/matlab.c',
'ctags/parsers/go.c',
'ctags/parsers/haskell.c',
'ctags/parsers/haxe.c',
Expand Down
6 changes: 4 additions & 2 deletions src/tagmanager/tm_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,13 @@ static TMParserMapGroup group_FORTRAN[] = {

static TMParserMapEntry map_MATLAB[] = {
{'f', tm_tag_function_t}, // function
{'s', tm_tag_struct_t}, // struct
{'v', tm_tag_variable_t}, // variable
{'c', tm_tag_class_t}, // class
};
static TMParserMapGroup group_MATLAB[] = {
{N_("Classes"), TM_ICON_CLASS, tm_tag_class_t},
{N_("Functions"), TM_ICON_METHOD, tm_tag_function_t},
{N_("Structures"), TM_ICON_STRUCT, tm_tag_struct_t},
{N_("Variables"), TM_ICON_VAR, tm_tag_variable_t},
};

#define map_CUDA map_C
Expand Down
10 changes: 10 additions & 0 deletions tests/ctags/matlab_backtracking.m.tags
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
backtrack�16�0
function: backtrack
cDDfnc�16384�0
variable: cDDfnc
d�16384�0
variable: d
fcall�16384�0
variable: fcall
fn�16384�0
variable: fn
xn�16384�0
variable: xn
6 changes: 4 additions & 2 deletions tests/ctags/matlab_test.m.tags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a bit sad… I'll see if I can get those fixed upstream (it's easy enough to patch actually -- yet, I don't have a clue about matlab 😁 )

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FAIL6�16�0
function: FAIL6
func1�16�0
function: func1
func2�16�0
Expand All @@ -6,5 +8,5 @@ func3
function: func3
func4�16�0
function: func4
func5�16�0
function: func5
functionality�16384�0
variable: functionality