Skip to content

Conversation

@tyrchen
Copy link
Owner

@tyrchen tyrchen commented Apr 27, 2025

Support cpp tree-sitter parser

@tyrchen tyrchen requested a review from Copilot April 27, 2025 21:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for a C++ tree-sitter parser, replacing the old C parser references with the new C++ parser in various modules. Key changes include updating re-exports and module references, removing the obsolete C parser implementation, and adding sample C++ code and test adjustments.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/parser/mod.rs Updated re-export to reference CppParser
src/parser/lang/mod.rs Renamed module and struct from CParser to CppParser
src/parser/lang/c.rs Removed obsolete C parser implementation
src/bank.rs Updated CodeBank references from CParser to CppParser
specs/instructions.md Expanded instructions to include C++ parser tests
fixtures/sample.cpp Added sample C++ code to illustrate new parser support
examples/parser.rs Updated example to use CppParser; output label remains unchanged (see suggestion)
Cargo.toml Changed dependency from tree-sitter-c to tree-sitter-cpp
Comments suppressed due to low confidence (1)

examples/parser.rs:34

  • The output label 'C:' may be misleading now that a C++ parser is used. Consider updating it to 'Cpp:' to clearly reflect that the parsed data comes from C++ source code.
println!("C:\n{:#?}", data);

@tyrchen tyrchen merged commit 4846704 into master Apr 27, 2025
1 check passed
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