Skip to content

Conversation

@diivm
Copy link
Collaborator

@diivm diivm commented Oct 23, 2020

  • Add utilities for some cindex.py's classes

  • Use those utilities to clean up parse.py

  • Use class in parse.py and clean

  • Add compilation_database.py

closes #19

@kunaltyagi
Copy link
Member

Any updates here?

@diivm
Copy link
Collaborator Author

diivm commented Jan 21, 2021

Hey!
Will pick it up in some time, been busy due to college.

@diivm diivm changed the title Polish parse.py Introduce clang_utils and related changes Feb 27, 2021
@diivm diivm force-pushed the polish-parse branch 2 times, most recently from 8b93868 to b6d3e58 Compare February 28, 2021 01:50
@diivm diivm marked this pull request as ready for review February 28, 2021 01:51
@diivm
Copy link
Collaborator Author

diivm commented Feb 28, 2021

@kunaltyagi Please have a look.

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

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

clang_utils.py is left. Will review it sometime soon

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

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

Can we add some documentation for CursorKind, Cursor and Type for a reader?

@diivm
Copy link
Collaborator Author

diivm commented Mar 27, 2021

Can we add some documentation for CursorKind, Cursor and Type for a reader?

@kunaltyagi
You mean apart from this? Or is this fine?

# Docstring template for the classes
class_docstring = """
- {class_name} class utilities.
- {description}
`check_functions_dict`:
- Functions that begin with "is_" i.e., checking functions
- A list of two-tuples: (function_name: str, function_value: function)
`get_functions_dict`:
- Functions that begin with "get_" i.e., getter functions
- A list of two-tuples: (function_name: str, function_value: function)
`properties_dict`:
- @property functions
- A list of two-tuples: (property_name: str, property_value: property)
"""
CursorKindUtils.__doc__ = class_docstring.format(
class_name="CursorKind",
description="A CursorKind describes the kind of entity that a cursor points to.",
)
CursorUtils.__doc__ = class_docstring.format(
class_name="Cursor",
description="The Cursor class represents a reference to an element within the AST. It acts as a kind of iterator.",
)
TypeUtils.__doc__ = class_docstring.format(
class_name="Type",
description="The Type class represents the type of an element in the abstract syntax tree.",
)

@kunaltyagi
Copy link
Member

I'd put some link/see-also comment here: https://github.com/PointCloudLibrary/clang-bind/pull/6/files#diff-ed2336087d363ffe402008e9acaeeddb1fb4bebcaab2ed4e20b04fc0dd790035R103

And in the classes you've linked to, is there some official clang documentation that we can link to? If not, then please add 1 or 2 examples there

@diivm
Copy link
Collaborator Author

diivm commented May 8, 2021

I'd put some link/see-also comment here: https://github.com/PointCloudLibrary/clang-bind/pull/6/files#diff-ed2336087d363ffe402008e9acaeeddb1fb4bebcaab2ed4e20b04fc0dd790035R103

And in the classes you've linked to, is there some official clang documentation that we can link to? If not, then please add 1 or 2 examples there

Couldn't find official documentation, but added links to the python API and the description of checks.

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

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

3/6 files ok. Will read the 3 remaining files in more detail soon

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

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

bindings/python/scripts/parse.py left. Need to review manually. GitHub shows a very difficult to read diff

@diivm diivm changed the title Introduce clang_utils and related changes Introduce clang_utils.py, compilation_database.py and related changes Jun 3, 2021
buildDir=compilation_database_path
)

def get_compilation_arguments(self, filename=None):
Copy link
Member

Choose a reason for hiding this comment

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

Filename required here? Shouldn't the db path in L9 solve this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Filename for the cpp file to be parsed, to get that file's compiler args from the compilation database.
If none, it will return the compiler args for all the files in the compilation db.

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

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

Approved because the parse logic will be changed soon anyways

@kunaltyagi
Copy link
Member

Any plans to clean up the commit history?

@diivm
Copy link
Collaborator Author

diivm commented Jun 12, 2021

Any plans to clean up the commit history?

Done 👍

@diivm
Copy link
Collaborator Author

diivm commented Jun 12, 2021

@kunaltyagi Let's merge?

@kunaltyagi kunaltyagi merged commit cc1ffd7 into PointCloudLibrary:master Jun 12, 2021
@diivm diivm deleted the polish-parse branch June 12, 2021 18:56
@diivm diivm mentioned this pull request Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

separate compile db logic into a new file

2 participants