Skip to content

Implement cpp_include parser - #2

Open
lizard-boy wants to merge 1 commit into
masterfrom
cpp_include
Open

Implement cpp_include parser#2
lizard-boy wants to merge 1 commit into
masterfrom
cpp_include

Conversation

@lizard-boy

Copy link
Copy Markdown

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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

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 thread src/main/organizer.ts
Comment on lines +38 to 44
case SyntaxType.CppIncludeDefinition:
cppIncludes.push(next)
break

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

Copy link
Copy Markdown

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