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

Add missing Geany parsers #2105

Closed
wants to merge 11 commits into from
Closed

Conversation

techee
Copy link
Contributor

@techee techee commented May 27, 2019

This pull request adds the extra parsers we have in Geany except those defined in c.c and except the markdown parser which is readLine() based and not really superior to the regex-based parser ctags uses (we should probably use the ctags parser in Geany instead).

The added parsers are:

For more details see the individual commits.

techee added 4 commits May 26, 2019 12:46
In addition to these parsers we also have a simple markdown parser
which however just uses readLine() interface and isn't token-based
so it's about equivalent to the regex-based parser in ctags (which
generates more kinds and is simpler so better to use that one). Plus
there are some more parsers inside c.c which however needs much more
work to merge with ctags.

I don't really know much about these parsers - some of them are for
really obscure languages like abaqus but they have been in Geany for
ages and seem to work.

This commit uses the parsers from pull request

geany/geany#2132

in which were some minor modifications so these parsers compile with
upstream ctags.
In Geany we used to modify all parsers so all of them generated the
same set of kinds which we then process internally the same way.
Now it is possible in Geany to redefine the ctags kinds to whatever
we need so these hacks are not necessary.

This patch modifies the kind names and kind letters so they better
match the real use in the affected parsers.
This commit adds unit tests we have in Geany for the new parsers.

The existing quemuhx test had to be updated to use
--language-force=QemuHX because the "hx" extension clashes with the
"hx" extension of the new Haxe parser and the test was using the Haxe
parser instead of quemuhx parser.
Add new parsers to news.rst.

Update Geany section in other-projects.rst:
1. Remove parsers from this pull request plus other parsers which have
already been added to ctags
2. Remove changes which have been merged section - there are many more
than those listed, these are just kind of random
@techee techee requested review from masatake and b4n May 27, 2019 10:38
@coveralls
Copy link

coveralls commented May 27, 2019

Coverage Status

Coverage increased (+0.03%) to 86.025% when pulling 2fc2149 on techee:geany_parsers into 3fdf28b on universal-ctags:master.

Copy link
Member

@masatake masatake left a comment

Choose a reason for hiding this comment

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

Could you add the pages about the languages in the commit log:

Abaqus (some obscure hardware definition language)
Abc (https://en.wikipedia.org/wiki/ABC_notation)
Docbook (https://en.wikipedia.org/wiki/DocBook)
Haskell (https://en.wikipedia.org/wiki/Haskell_(programming_language))
Haxe (https://en.wikipedia.org/wiki/Haxe)
Nsis (https://en.wikipedia.org/wiki/Nullsoft_Scriptable_Install_System)
Powershell (https://en.wikipedia.org/wiki/PowerShell)
Txt2tags (https://en.wikipedia.org/wiki/Txt2tags)

to each parser source file?

parsers/abc.c Outdated Show resolved Hide resolved
parsers/abaqus.c Show resolved Hide resolved
parsers/abc.c Show resolved Hide resolved
parsers/haskell.c Outdated Show resolved Hide resolved
parsers/abc.c Outdated Show resolved Hide resolved
@masatake
Copy link
Member

I will add a selector for .hx file.

@masatake
Copy link
Member

Thank you very much.

techee added 6 commits May 27, 2019 11:32
The commented-out code is unmaintained and it's hard to say what
exactly it's supposed to do. If someone wants to improve the parser
in the future, writing something like that shouldn't be hard so
nothing of a value will be lost.
Based on the pull request information provided in

geany/geany#81
@techee
Copy link
Contributor Author

techee commented May 27, 2019

Could you add the pages about the languages in the commit log:

Abaqus (some obscure hardware definition language)
Abc (https://en.wikipedia.org/wiki/ABC_notation)
Docbook (https://en.wikipedia.org/wiki/DocBook)
Haskell (https://en.wikipedia.org/wiki/Haskell_(programming_language))
Haxe (https://en.wikipedia.org/wiki/Haxe)
Nsis (https://en.wikipedia.org/wiki/Nullsoft_Scriptable_Install_System)
Powershell (https://en.wikipedia.org/wiki/PowerShell)
Txt2tags (https://en.wikipedia.org/wiki/Txt2tags)

to each parser source file?

Done, including Abaqus as well (which actually isn't a hardware-definition language as I thought but some simulation software language).

docs/news.rst Outdated
* ObjectiveC
* Passwd *optlib*
* PuppetManifest *optlib*
* Perl6
* Pod *optlib*
* Powershell
Copy link
Member

Choose a reason for hiding this comment

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

Very minor issue. Powershell should be PowerShell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, including a few more capitalization problems.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you.

@masatake
Copy link
Member

If there is no trouble at Geany side, I would like you to do one of following two:
A. squash the commits into one then merge it, or
B. convert the commits into per-parser commits and merge them.

@techee
Copy link
Contributor Author

techee commented May 28, 2019

If there is no trouble at Geany side, I would like you to do one of following two:
A. squash the commits into one then merge it, or
B. convert the commits into per-parser commits and merge them.

No problem, I guess A will be easier to do.

@techee
Copy link
Contributor Author

techee commented May 28, 2019

I opened a separate pull request with the rebased version in #2106 so the individual commits are still visible if e.g. @b4n wants to have a look at them. Closing this pull request.

@techee techee closed this May 28, 2019
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.

3 participants