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

Implement cpp_include parser #2

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

Implement cpp_include parser #2

wants to merge 1 commit into from

Conversation

lizard-boy
Copy link

It seems that the current version does not include the implementation of cpp_include entries and it throws an error when running into it. This PR implements the parsing logic for cpp_include. It mimics the code for include syntax.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request implements parsing for 'cpp_include' statements in Thrift files, enhancing the parser's compatibility with Thrift documents that use C++ include directives.

  • Added parseCppInclude() function in src/main/parser.ts to handle cpp_include statements
  • Implemented storage and organization of CppIncludeDefinition objects in src/main/organizer.ts
  • Created new test fixture cpp_include.thrift and corresponding solution JSON for validation
  • Added a test case in parser.spec.ts to ensure correct parsing of cpp_include syntax
  • Updated parseStatement() and isStatementBeginning() functions to recognize cpp_include keywords

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +38 to 44
case SyntaxType.CppIncludeDefinition:
cppIncludes.push(next)
break

case SyntaxType.CppIncludeDefinition:
// We're not generating C++
break
Copy link

Choose a reason for hiding this comment

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

logic: Duplicate case for SyntaxType.CppIncludeDefinition. Remove the second case.

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.

2 participants