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

Pascal: extract type #3212

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

masatake
Copy link
Member

@masatake masatake commented Dec 2, 2021

This is mostly based on #2241 submitted by @ntrel.
I adjusted the changes to fit the latest codebase.

masatake and others added 3 commits December 3, 2021 04:57
Close universal-ctags#2241.

@mastake's note:
This pull chnage is based on universal-ctags#2241 submitted by @ntrel.
I adjust the change not to fill "signature" field for tags of "type" kind.
I also adjust the change to avoid regression.
@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #3212 (37b2ed7) into master (7e06c76) will increase coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3212   +/-   ##
=======================================
  Coverage   84.94%   84.95%           
=======================================
  Files         206      206           
  Lines       49030    49044   +14     
=======================================
+ Hits        41650    41665   +15     
+ Misses       7380     7379    -1     
Impacted Files Coverage Δ
parsers/pascal.c 91.57% <83.33%> (+1.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e06c76...37b2ed7. Read the comment docs.

{
if (tail ("type")) /* check for type declaration */
{
found_tag = false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are not covered by the test cases.

@masatake
Copy link
Member Author

masatake commented Dec 2, 2021

If more than two types are defined under the type keyword, the change doesn't work.

https://www.gnu-pascal.de/gpc/Type-Declaration.html

     type
       { This side is the }     { That side is the }
       { type declaration }     { type definition  }
     
       Arrayfoo            = array [0 .. 9] of Integer;  { array definition }
       Recordfoo           = record                      { record definition }
                               Bar: Integer;
                             end;
     
            { schema def with discriminants ``x, y: Integer'' }
       SchemaFoo (x, y: Integer) = array [x .. y] of Integer;
       CharSetFoo          = set of Char;              { Def of a set }
       ObjectFoo           = object                    { Def of an object }
                               procedure DoAction;
                               constructor Init;
                               destructor Done;
                             end;
       SubrangeFoo         = -123..456;                { subrange def }
     
       EnumeratedFoo       = (Pope,John,the,Second);   { enum type def }
            { Def of a pointer to another type identifier }
       PInteger            = ^arrayfoo;
            { Def of an alias name for another type identifier }
       IdentityFoo         = Integer;
            { Def of an integer which was initialized by 123 }
       InitializedFoo      = Integer value 123;

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

2 participants