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 Geany parsers which are missing in ctags (rebased version) #2106

Closed
wants to merge 1 commit into from

Conversation

techee
Copy link
Contributor

@techee techee commented May 28, 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:

Some small cleanups were made to the Abc parser compared to Geany
version - basically just commented code removal.

The patch also adds simple unit tests from Geany. Because the added
Haxe parser extension "hx" clashes with QemuHX file extension,
--language-force=QemuHX had to be added to the args of QemuHX tests.

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:

* Abaqus (https://en.wikipedia.org/wiki/Abaqus)
* 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)

Some small cleanups were made to the Abc parser compared to Geany
version - basically just commented code removal.

The patch also adds simple unit tests from Geany. Because the added
Haxe parser extension "hx" clashes with QemuHX file extension,
--language-force=QemuHX had to be added to the args of QemuHX tests.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 86.025% when pulling 418fb97 on techee:geany_parsers2 into 3fdf28b on universal-ctags:master.

@masatake
Copy link
Member

The patch also adds simple unit tests from Geany. Because the added
Haxe parser extension "hx" clashes with QemuHX file extension,
--language-force=QemuHX had to be added to the args of QemuHX tests.

Currently, the methods guessing a proper parser file contents are implemented in C language.
However, I would like to prepare the way to define guessng rule in command line/optlib.

@masatake
Copy link
Member

@techee, I changd my mind.
Can I split this pull request into smaller pull requests; each pull request introduces only one parser?

@masatake
Copy link
Member

Nsis parser is merged with many improvements.
The next target for merging may be ... docbook.

@masatake masatake self-assigned this Jul 15, 2019
@masatake
Copy link
Member

See #2144 and #2145.
When merging a parser, we must verify the version of GPL is written in the source file of the parser.

@techee
Copy link
Contributor Author

techee commented Jul 24, 2019

I hope to find some time for this soon.

@masatake
Copy link
Member

About DocBook parser, I'm thinking about rewriting it in XPath based.
I will write the reason in its pull request.

@masatake
Copy link
Member

masatake commented Aug 4, 2019

Docbook parser captures id=... It is good. However, I think the parser should capture <title>...</title>, too.

Generally the parsers of ctags captures identifiers. The big exception is in parsers for documentation language like reStructuredText, and Markdown. Capturing titles of sections has higher priority than capturing identifiers. This is not my design. This direction of design is already taken by Exuberant-crags. I just follow the policy. (I myself think capturing identifiers is important than capruting titles.)

To align the behaviour to other parsers for documents, Docbook parser should capture <title>...</title>.
To capture <title>...</title> in the docbook parser, I will convert the docbook parser XML parser based.

If our docbook parser is a subparser of XML barser, ids are captured automatically.
See #2164.

masatake added a commit to masatake/ctags that referenced this pull request Sep 16, 2019
@masatake masatake mentioned this pull request Sep 16, 2019
masatake added a commit to masatake/ctags that referenced this pull request Sep 16, 2019
@techee
Copy link
Contributor Author

techee commented Nov 19, 2020

I've created pull requests #2712 (Haskell), #2713 (abc), #2714 (haxe), #2715 (abaqus) and #2716 (txt2tags) with one parser per pull request. I'm closing this pull request in favor of the above requests.

@techee techee closed this Nov 19, 2020
@masatake
Copy link
Member

I'm sorry to be late. Thank you for splitting this into pull requests.

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