Commit Graph

2 Commits

Author SHA1 Message Date
dhiebert 5032fc0752 Fixed up files relating to new parsers added by David Fishburn.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@724 c5d04d22-be80-434c-894e-aa346cc9e8e8
2009-07-09 20:54:01 +00:00
dfishburn 2ab351ae2e Four new parsers have been added.
ant.c

Specifically looks for a build.xml file.
Produces 2 types of tags:
    p,project
    t,target

It is a regex based parser using the following expressions:
    "^[ \t]*<[ \t]*project.*name=\"([^\"]+)\".*", "\\1", "p,project,projects"
    "^[ \t]*<[ \t]*target.*name=\"([^\"]+)\".*", "\\1", "t,target,targets"

Will find tags for the following lines:
    <project name="MyProject" default="deploy" basedir=".">
    <target name="init">

Test file:
    build.xml



dosbatch.c

Looks for files with .cmd or .bat extensions.
Produces 2 types of tags:
    l,label
    v,variable

It is a regex based parser using the following expressions:
    "^:([A-Za-z_0-9]+)", "\\1", "l,label,labels"
    "set[ \t]+([A-Za-z_0-9]+)[ \t]*=", "\\1", "v,variable,variables"

Will find tags for the following lines:
    :ERROR
    @IF NOT DEFINED SCRIPT_DIR FOR /f %%i IN ('cd') DO @SET SCRIPT_DIR=%%i

Test file:
    dosbatch_test.cmd



matlab.c

Looks for files with .m extension.
Produces 1 types of tag:
    f,function

It is a regex based parser using the following expressions:
    "^function[ \t]*\\[.*\\][ \t]*=[ \t]*([a-zA-Z0-9_]+)", "\\1", "f,function"
    "^function[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*([a-zA-Z0-9_]+)", "\\1", "f,function"
    "^function[ \t]*([a-zA-Z0-9_]+)[^=]*$", "\\1", "f,function"

Will find tags for the following lines:
    :ERROR
    @IF NOT DEFINED SCRIPT_DIR FOR /f %%i IN ('cd') DO @SET SCRIPT_DIR=%%i

Test files:
    matlab_backtracking.m
    matlab_test.m



tex.c

Looks for files with .tex extension.
Produces 1 types of tag:
    c,chapter
    s,section
    u,subsection
    b,subsubsection
    p,package

It is a token parser which can handle tags of this format:
    \keyword{any number of words}
    \keyword[short desc]{any number of words}
    \keyword*[short desc]{any number of words}
    \keyword[short desc]*{any number of words}
    
Will find tags for the following lines:
    \usepackage{amsmath}
    \chapter{chapter text}
    \section{section1 text}
    \subsection{subsection2}
    \subsubsection{subsubsection3 with extra text}

Test files:
    intro.tex
    intro_orig.tex



git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@693 c5d04d22-be80-434c-894e-aa346cc9e8e8
2008-12-14 13:19:48 +00:00