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

optlib: allow users to set fields and check extras defined in a foreign language #3960

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

masatake
Copy link
Member

In addition, this pull request allows you to fill out a field for a foreign tag from optscript.

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 88.05970% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 85.40%. Comparing base (39bbe0a) to head (cbdc8c8).
Report is 4 commits behind head on master.

Files Patch % Lines
main/field.c 83.67% 8 Missing ⚠️
main/parse.c 91.66% 3 Missing ⚠️
main/lregex.c 83.33% 2 Missing ⚠️
main/script.c 93.93% 2 Missing ⚠️
main/options.c 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3960      +/-   ##
==========================================
+ Coverage   85.38%   85.40%   +0.01%     
==========================================
  Files         235      235              
  Lines       56543    56648     +105     
==========================================
+ Hits        48282    48379      +97     
- Misses       8261     8269       +8     

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

@masatake masatake marked this pull request as draft March 14, 2024 23:51
…for newly defined field

Signed-off-by: Masatake YAMATO <[email protected]>
--_list-fielddef-flags option is added, too.

Signed-off-by: Masatake YAMATO <[email protected]>
…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 <[email protected]>
…field setters

This is a preparation. A test case for raising the error introduced in
this commit will be added when we have real field accessors.

Signed-off-by: Masatake YAMATO <[email protected]>
The operators (setter and/or getter) for each field.
The name of operatos has following form:

	setter => :<LANG>.<FIELD>
	getter => <LANG>.<FIELD>:

NOTE: The operators for a field are defined only if the
field has C level getters and setters, getValueObject and setValueObject
in fieldDefinition. This commit doesn't provide a getter and a setter.
The test cases and the real accessor will be implemented later.

Signed-off-by: Masatake YAMATO <[email protected]>
…ned in an optlib parser

Signed-off-by: Masatake YAMATO <[email protected]>
…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 <[email protected]>
@masatake
Copy link
Member Author

The ways to support boolean fields are not consistent in various aspects.

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.

None yet

1 participant