universal-ctags / ctags

A maintained ctags implementation
https://ctags.io
GNU General Public License v2.0
6.51k stars 622 forks source link

LEX: make reference tags for the conditions used for making groups #3939

Closed masatake closed 7 months ago

masatake commented 7 months ago

In some lexers, all the rules for a condition are grouped together as:

<COND>{
...
}

It is useful to be able to jump to these blocks.

Conditions used for grouping are tagged as reference tags having "grouping" role of "cond" kind. So you must add --extras=+r to your ctags cmdline for enabling this support.

Update the parser version to 1.1.

This is derrived from #3937.

masatake commented 7 months ago

My idea:

%x COND
...
<COND> {
...
}

The first COND is introduced as a new name that points to a language object. The second COND is not introduced as a new name. Instead, the second COND refers to the language object introduced with the first COND.

codecov[bot] commented 7 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c26e151) 85.38% compared to head (33d3068) 85.38%.

Files Patch % Lines
optlib/lex.c 0.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3939 +/- ## ========================================== - Coverage 85.38% 85.38% -0.01% ========================================== Files 234 234 Lines 56200 56202 +2 ========================================== Hits 47987 47987 - Misses 8213 8215 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

masatake commented 7 months ago

https://sources.debian.org/patche/exuberant-ctags/1:5.9~svn20110310-11/python-disable-imports.patch/

From the comment in the patch, You will know why I am concerned about whether a language object is extracted as a definition or reference tag.