-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to uctags regex-based matlab parser
Even though the output isn't perfect, I'd prefer not to maintain our own version of the parser (with different kinds which makes ctags files incompatible with our version).
- Loading branch information
Showing
7 changed files
with
73 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters