Skip to content

Commit

Permalink
Merge pull request #3143 from masatake/cases-for-direction-flags
Browse files Browse the repository at this point in the history
Units, docs(web): add cases for testing direction flags of langdef option
  • Loading branch information
masatake committed Sep 4, 2021
2 parents 52b2a79 + 755aeae commit ca81123
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Units/flags-langdef-directions.r/bidirectional.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--sort=no
--fields=+{language}

--langdef=Base
--map-Base=.base
--kinddef-Base=b,basefunc,functions in Base language
--regex-Base=/(^[a-z0-9]+)\(/\1/b/

--langdef=Sub{base=Base}{bidirectional}
--map-Sub=.sub
--kinddef-Sub=s,subdef,definitions in Sub language
--regex-Sub=/[ \t]*@def[ \t]+([a-z0-9]+).*;$/\1/d/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
f input.base /^f() [$/;" b language:Base
v input.base /^ @def v 1;$/;" d language:Sub
f0 input-0.sub /^f0() [$/;" b language:Base
v0 input-0.sub /^ @def v0 1;$/;" d language:Sub
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/bidirectional.d/input-0.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f0() [
@def v0 1;
]
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/bidirectional.d/input.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f() [
@def v 1;
]
12 changes: 12 additions & 0 deletions Units/flags-langdef-directions.r/dedicated.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--sort=no
--fields=+{language}

--langdef=Base
--map-Base=.base
--kinddef-Base=b,basefunc,functions in Base language
--regex-Base=/(^[a-z0-9]+)\(/\1/b/

--langdef=Sub{base=Base}{dedicated}
--map-Sub=.sub
--kinddef-Sub=s,subdef,definitions in Sub language
--regex-Sub=/[ \t]*@def[ \t]+([a-z0-9]+).*;$/\1/d/
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/dedicated.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f input.base /^f() [$/;" b language:Base
f0 input-0.sub /^f0() [$/;" b language:Base
v0 input-0.sub /^ @def v0 1;$/;" d language:Sub
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/dedicated.d/input-0.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f0() [
@def v0 1;
]
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/dedicated.d/input.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f() [
@def v 1;
]
12 changes: 12 additions & 0 deletions Units/flags-langdef-directions.r/default.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--sort=no
--fields=+{language}

--langdef=Base
--map-Base=.base
--kinddef-Base=b,basefunc,functions in Base language
--regex-Base=/(^[a-z0-9]+)\(/\1/b/

--langdef=Sub{base=Base}
--map-Sub=.sub
--kinddef-Sub=s,subdef,definitions in Sub language
--regex-Sub=/[ \t]*@def[ \t]+([a-z0-9]+).*;$/\1/d/
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/default.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f input.base /^f() [$/;" b language:Base
v input.base /^ @def v 1;$/;" d language:Sub
v0 input-0.sub /^ @def v0 1;$/;" d language:Sub
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/default.d/input-0.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f0() [
@def v0 1;
]
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/default.d/input.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f() [
@def v 1;
]
12 changes: 12 additions & 0 deletions Units/flags-langdef-directions.r/shared.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--sort=no
--fields=+{language}

--langdef=Base
--map-Base=.base
--kinddef-Base=b,basefunc,functions in Base language
--regex-Base=/(^[a-z0-9]+)\(/\1/b/

--langdef=Sub{base=Base}{shared}
--map-Sub=.sub
--kinddef-Sub=s,subdef,definitions in Sub language
--regex-Sub=/[ \t]*@def[ \t]+([a-z0-9]+).*;$/\1/d/
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/shared.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f input.base /^f() [$/;" b language:Base
v input.base /^ @def v 1;$/;" d language:Sub
v0 input-0.sub /^ @def v0 1;$/;" d language:Sub
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/shared.d/input-0.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f0() [
@def v0 1;
]
3 changes: 3 additions & 0 deletions Units/flags-langdef-directions.r/shared.d/input.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f() [
@def v 1;
]
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ See also [Writing Documents](https://docs.ctags.io/en/latest/contributions.html#
- "`IN MAN PAGE`" means the topic is also explained in the man page of ctags.
- "`.. TODO: ...`": TODO comments for documents.
- "`.. TODO(code): ...`": TODO comments for programming codes.
- "`.. TESTCASE: ...`": A test case for the feature documented is at ....

## Generating man pages ###

Expand Down
2 changes: 2 additions & 0 deletions docs/optlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,8 @@ In addition you can enable/disable with the subparser usable
Direction flags
.........................................................................
.. TESTCASE: Units/flags-langdef-directions.r
As explained in ":ref:`multiple_parsers_directions`" in
":ref:`multiple_parsers`", you can choose direction(s) how a base parser and a
guest parser work together with direction flags.
Expand Down
2 changes: 2 additions & 0 deletions docs/running-multi-parsers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ subparser can be chosen only top down way or bottom up ways.
Direction flags
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

.. TESTCASE: Units/flags-langdef-directions.r
*Direction flags* specify how a base parser and a subparser work together. You
can choose directions by putting a long flag after
``--langdef=<SUB_LANG>{base=<BASE_LANG>}``.
Expand Down

0 comments on commit ca81123

Please sign in to comment.