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

If variable name contains "type" Pascal parser recognized non-existing symbol #1409

Closed
peter-scholtens opened this issue Feb 24, 2017 · 8 comments

Comments

@peter-scholtens
Copy link
Contributor

If a variable name ends with "type", the symbol parser recognizes a symbol which does not exist. As an example, see the following code below:

procedure plot_labels(iy,iy2: stipint; labtype: stipint);
const
c_marker_type=1;
var
locdbg: boolean;
{actual code}
end;

Which creates two functions: plot_labels (correct) and 1 (this is incorrect). See screenshot below:

image

@codebrainz
Copy link
Member

It seems not only to be if ends in type but it seems to have to end in type=X;. If you change type, or remove the = or remove the X (or number or whatever), or remove the ; it works normally. I tried looking at the Pascal parser but it's really weird, would be easier to re-write it from scratch than decode it.

@codebrainz
Copy link
Member

@peter-scholtens BTW, I think this parser is the same as in Universal CTags, it might get more attention if reported there (for example by generating an invalid tag file ctags directly).

@elextr
Copy link
Member

elextr commented Feb 25, 2017

No its not the same, the ctags one is missing the part at line 258 where it tests for "type" which is likely the problem.

I tried looking at the Pascal parser but it's really weird,

See the comment "Algorithm adapted from from GNU etags." gives the game away :)

@elextr
Copy link
Member

elextr commented Feb 25, 2017

Pascal doesn't seem to be part of the omnibus ctags sync PR #1263 either for some reason (@techee ?)

@codebrainz
Copy link
Member

@elextr good eye on the difference, seems that was added in 72b7390, and based on the commit message it was added to solve the exact problem it causes?

@techee
Copy link
Member

techee commented Feb 25, 2017

@elextr The aim of #1263 isn't to sync parsers - with parsers sync it would be MUCH bigger. It just makes Geany ready so we can use all uctags features in parsers. Parsers will be synced next (but this will fortunately be possible one by one so no huge pull requests any more).

@elextr
Copy link
Member

elextr commented Feb 26, 2017

@techee ok

Of course taking out 72b7390 will again expose whatever problem it was fixing.

@techee
Copy link
Member

techee commented Jan 4, 2022

Seems to be fixed with the latest pascal parser.

@techee techee closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants