Skip to content

Add support for OCaml. #4758

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add support for OCaml. #4758

wants to merge 1 commit into from

Conversation

progoramur
Copy link

I am signing Oracle Contributor Agreement.

This pull request adds support for OCaml.

Almost full support for OCaml syntax is provided including quoted string literals and extension nodes. The support for docstrings is not implemented. Also, primitive types are added to the list of keywords because most programmers do not use them as variable names (result is an exception).

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Apr 15, 2025
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Apr 15, 2025
Copy link
Member

@vladak vladak left a comment

Choose a reason for hiding this comment

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

in general this looks good, the copyright commens have to be addressed.

@vladak
Copy link
Member

vladak commented Apr 15, 2025

Also, it would be nice to supply a sample OCaml file + expected xref and add a test checking it, similarly to some other analyzers.

@progoramur
Copy link
Author

Also, it would be nice to supply a sample OCaml file + expected xref and add a test checking it, similarly to some other analyzers.

Will add within couple days.

Could you please give a good example?

@vladak
Copy link
Member

vladak commented Apr 15, 2025

Also, it would be nice to supply a sample OCaml file + expected xref and add a test checking it, similarly to some other analyzers.

Will add within couple days.

Could you please give a good example?

See the recently changed Fortran analyzer (PR #4642) for example.

@progoramur
Copy link
Author

@vladak thanks for the hints. Added tests, please take a look.

@vladak
Copy link
Member

vladak commented Apr 16, 2025

There is a pre-existing issue tracking the OCaml support (#4407), please add fixes #4407 to the commit comment.

@vladak
Copy link
Member

vladak commented Apr 16, 2025

Also, rebase.

import org.opengrok.indexer.analysis.JFlexSymbolMatcher;

/**
* @author Harry Pan
Copy link
Member

Choose a reason for hiding this comment

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

you might want to update this one.


ByteArrayOutputStream baos = new ByteArrayOutputStream();

InputStream res = getClass().getClassLoader().getResourceAsStream(
Copy link
Member

Choose a reason for hiding this comment

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

feel free to join these lines, the lines can be pretty long

<property name="max" value="150"/>

@vladak
Copy link
Member

vladak commented Apr 16, 2025

I believe the newly introduced files do not have to have the Portions in the copyright.

*/

/*
* Portions Copyright (c) 2025, Yelisey Romanov <progoramur@gmail.com>.
Copy link
Author

Choose a reason for hiding this comment

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

This file is largely based upon Haskell test suite. So, let's leave copyright partial.

Copy link
Member

Choose a reason for hiding this comment

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

In such case the copyright from the original file should be retained.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, done!

@progoramur progoramur requested a review from vladak April 18, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants