Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main: use extras and fields in the foreign language specified in {_language=...} flag #4059

Conversation

masatake
Copy link
Member

@masatake masatake commented Aug 27, 2024

These are mergeable parts in #3960.

I'm using the feature proposed in this pull request like this:

--langdef=KernelConfig{_foreignLanguage=Kconfig}

--_roledef-Kconfig.{config}=set,set in .config file
--_roledef-Kconfig.{config}=unset,unset in .config file

--map-KernelConfig=.config

--regex-KernelConfig=/^CONFIG_([^=]+)/\1/c/{_language=Kconfig}{_role=set}
--regex-KernelConfig=/^(CONFIG_[^=]+)/\1/c/{_language=Kconfig}{_role=set}{_extra=configPrefixed}{exclusive}

--regex-KernelConfig=/^\# CONFIG_([^ ]+) is not set/\1/c/{_language=Kconfig}{_role=unset}{exclusive}
--regex-KernelConfig=/^\# (CONFIG_[^ ]+) is not set/\1/c/{_language=Kconfig}{_role=unset}{_extra=configPrefixed}{exclusive}

The KernelConfig parser extracts "CONFIG_FOO=..." from foo.config.
The definition of CONFIG_FOO is in Kconfig. The Kconfig parser extracts the definition.

In foo.config, CONFIG_FOO= is set or unset. The KernelCOnfig parser can extract CONFIG_FOO as a reference tag of Kconfig language.

KernelConfig doesn't define its own kinds.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.49%. Comparing base (a7b07d7) to head (500d0b6).

Files Patch % Lines
main/lregex.c 75.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4059   +/-   ##
=======================================
  Coverage   85.49%   85.49%           
=======================================
  Files         237      237           
  Lines       57036    57040    +4     
=======================================
+ Hits        48761    48765    +4     
  Misses       8275     8275           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ng _field regex flag

The original code assumed the parser specified in a regex pattern
was the owner of the field specified with the _field regex flag in
the pattern.

For an example, in the option

    --regex-Foo=/.../{_field=afield:\1}...

, ctags assumed "afield" was a specific field of "Foo" parser.
The original code didn't consider an option like

    --regex-Foo=/.../{_language=Bar}{_field=afield:\1}...

In this case, ctags should consider "afield" as a specific
field of "Bar" parser.

NOTE: the language specified with _language flag must be
declared with _foreignLanguage= in --langdef-Foo.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…xtra regex flag

The original code assumed the parser specified in a regex pattern
was the owner of the extra specified with the _extra regex flag in
the pattern.

For an example, in the option

    --regex-Foo=/.../{_extra=anextra}...

, ctags assumed "anextra" was a specific extra of "Foo" parser.
The original code didn't consider an option like

    --regex-Foo=/.../{_language=Bar}{_extra=anextra}...

In this case, ctags should consider "anextra" as a specific
extra of "Bar" parser.

NOTE: the language specified with _language flag must be
declared with _foreignLanguage= in --langdef-Foo.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake masatake force-pushed the main--extras-and-fields-in-foreign-language branch from 500d0b6 to 1d0be58 Compare August 27, 2024 17:06
@masatake masatake merged commit e2d3723 into universal-ctags:master Aug 28, 2024
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant