parseReturnType should start from the first non-brace token
[arduino-ctags.git] / matlab.c
blob08114576b2d84c171cd13681d4447c35c5c8eb61
1 /*
2 * $Id$
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.
13 * INCLUDE FILES
15 #include "general.h" /* must always come first */
17 #include <string.h>
18 #include "parse.h"
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);
30 /* function asdf */
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;
40 def->regex = TRUE;
41 return def;
44 /* vi:set tabstop=4 shiftwidth=4: */