4 * Copyright (c) 2008, David Fishburn
6 * This source code is released for free distribution under the terms of the
7 * GNU General Public License.
9 * This module contains functions for generating tags for MATLAB language files.
15 #include "general.h" /* must always come first */
21 * FUNCTION DEFINITIONS
24 static void installMatLabRegex (const langType language
)
26 /* function [x,y,z] = asdf */
27 addTagRegex (language
, "^function[ \t]*\\[.*\\][ \t]*=[ \t]*([a-zA-Z0-9_]+)", "\\1", "f,function", NULL
);
28 /* function x = asdf */
29 addTagRegex (language
, "^function[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*([a-zA-Z0-9_]+)", "\\1", "f,function", NULL
);
31 addTagRegex (language
, "^function[ \t]*([a-zA-Z0-9_]+)[^=]*$", "\\1", "f,function", NULL
);
34 extern parserDefinition
* MatLabParser ()
36 static const char *const extensions
[] = { "m", NULL
};
37 parserDefinition
* const def
= parserNew ("MatLab");
38 def
->extensions
= extensions
;
39 def
->initialize
= installMatLabRegex
;
44 /* vi:set tabstop=4 shiftwidth=4: */