Skip to content

Commit

Permalink
Texinfo: new parser
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed May 14, 2023
1 parent dbeed62 commit da4af9c
Show file tree
Hide file tree
Showing 17 changed files with 741 additions and 25 deletions.
7 changes: 7 additions & 0 deletions Tmain/list-params.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
CTAGS=$1
C="${CTAGS} --quiet --options=NONE"

ignore_pcre2()
{
grep -v Texinfo
}

{
echo '# ALL'
${C} --with-list-header=yes --list-params
echo
Expand Down Expand Up @@ -31,3 +37,4 @@ echo
echo '# CPP MACHINABLE NOHEADER + PARAM DEFINE WITH CMDLINE'
${C} --_paramdef-CPreProcessor='pragma,handle program' --with-list-header=no --machinable --list-params=CPreProcessor
echo
} | ignore_pcre2
2 changes: 1 addition & 1 deletion Tmain/list-roles-with-kind-names.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo '{header}'
${CTAGS} --list-roles=all.'{header}'

echo '{header}I'
${CTAGS} --list-roles=all.'{header}I'
${CTAGS} --machinable=yes --list-roles=all.'{header}I' | grep -v Texinfo

echo 'd{header}'
${CTAGS} --list-roles=all.'d{header}'
40 changes: 20 additions & 20 deletions Tmain/list-roles-with-kind-names.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ OldC++ h/header system on system header
Vera h/header local on local header
Vera h/header system on system header
{header}I
#LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION
C h/header local on local header
C h/header system on system header
C++ h/header local on local header
C++ h/header system on system header
CPreProcessor h/header local on local header
CPreProcessor h/header system on system header
CUDA h/header local on local header
CUDA h/header system on system header
Flex I/import import on imports
M4 I/macrofile included on included macro
M4 I/macrofile sincluded on silently included macro
Make I/makefile included on included
Make I/makefile optional on optionally included
OldC h/header local on local header
OldC h/header system on system header
OldC++ h/header local on local header
OldC++ h/header system on system header
Vera h/header local on local header
Vera h/header system on system header
#LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION
C h/header local on local header
C h/header system on system header
C++ h/header local on local header
C++ h/header system on system header
CPreProcessor h/header local on local header
CPreProcessor h/header system on system header
CUDA h/header local on local header
CUDA h/header system on system header
Flex I/import import on imports
M4 I/macrofile included on included macro
M4 I/macrofile sincluded on silently included macro
Make I/makefile included on included
Make I/makefile optional on optionally included
OldC h/header local on local header
OldC h/header system on system header
OldC++ h/header local on local header
OldC++ h/header system on system header
Vera h/header local on local header
Vera h/header system on system header
d{header}
#LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION
Automake d/directory data on directory for DATA primary
Expand Down
11 changes: 8 additions & 3 deletions Tmain/list-roles.d/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,22 @@ ignore_old()
grep -v '^Old'
}

ignore_pcre2()
{
grep -v '^Texinfo'
}

title ''
${CTAGS} --quiet --options=NONE --list-roles= | ignore_xml | ignore_old | ignore_yaml
${CTAGS} --quiet --options=NONE --list-roles= | ignore_xml | ignore_old | ignore_yaml | ignore_pcre2

title 'all.*'
${CTAGS} --quiet --options=NONE --list-roles='all.*' | ignore_xml | ignore_old | ignore_yaml
${CTAGS} --quiet --options=NONE --list-roles='all.*' | ignore_xml | ignore_old | ignore_yaml | ignore_pcre2

title 'C.*'
${CTAGS} --quiet --options=NONE --list-roles='C.*'

title 'all.d'
${CTAGS} --quiet --options=NONE --list-roles='all.d' | ignore_xml | ignore_old | ignore_yaml
${CTAGS} --quiet --options=NONE --list-roles='all.d' | ignore_xml | ignore_old | ignore_yaml | ignore_pcre2

title 'Sh.s'
${CTAGS} --quiet --options=NONE --list-roles='Sh.s'
Expand Down
2 changes: 2 additions & 0 deletions Units/parser-texinfo.r/lisp-param-elisp.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--extras=+g
1 change: 1 addition & 0 deletions Units/parser-texinfo.r/lisp-param-elisp.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec input.texi /^(defun exec (cmd)$/;" f
1 change: 1 addition & 0 deletions Units/parser-texinfo.r/lisp-param-elisp.d/features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pcre2
4 changes: 4 additions & 0 deletions Units/parser-texinfo.r/lisp-param-elisp.d/input.texi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@lisp
(defun exec (cmd)
...)
@end lisp
3 changes: 3 additions & 0 deletions Units/parser-texinfo.r/lisp-param-scheme.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+g
--param-Texinfo.LispLang=Scheme
1 change: 1 addition & 0 deletions Units/parser-texinfo.r/lisp-param-scheme.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec input.texi /^(define (exec cmd)$/;" f
1 change: 1 addition & 0 deletions Units/parser-texinfo.r/lisp-param-scheme.d/features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pcre2
4 changes: 4 additions & 0 deletions Units/parser-texinfo.r/lisp-param-scheme.d/input.texi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@lisp
(define (exec cmd)
...)
@end lisp
1 change: 1 addition & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ The following parsers have been added:
* TerraformVariables *optlib*
* Thrift *peg/packcc*
* TTCN
* Texinfo *optlib pcre2*
* Txt2tags
* TypeScript
* Varlink *peg/packcc*
Expand Down
3 changes: 2 additions & 1 deletion main/parsers_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@

#ifdef HAVE_PCRE2
#define OPTLIB2C_PCRE2_PARSER_LIST \
RDocParser
RDocParser, \
TexinfoParser
#else
#define OPTLIB2C_PCRE2_PARSER_LIST
#endif
Expand Down
Loading

0 comments on commit da4af9c

Please sign in to comment.