-
Notifications
You must be signed in to change notification settings - Fork 1
Add test demonstrating AST traversal and type checking #61
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
Add test demonstrating AST traversal and type checking #61
Conversation
Adds test_parse_integer() which parses an integer literal type alias and traverses the AST (TypeAlias -> LiteralType -> Integer) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable idiomatic Rust AST traversal with proper type safety. Also adds Debug derives and fixes memory management by returning SignatureNode instead of raw pointer, with Drop impl to free parser.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| impl Drop for SignatureNode { | ||
| fn drop(&mut self) { | ||
| unsafe { | ||
| rbs_parser_free(self.parser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amomchilov one doubt we had that I wanted to double check with you: does this also free all of the nodes thanks to the arena allocator? Or do we also need to free the nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll fix it forward if necessary. Merging as is for now.
c2d9326
into
11-20-handle_rbskeyword_types
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.

Adds
test_parse_integer()which parses an integer literal type alias and traverses the AST (TypeAlias->LiteralType->Integer) using pattern matching to verify node types and extract values.This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety.
Also adds
Debugderives and refactors memory management by returningSignatureNodeinstead of raw pointer, withDropimpl to free parser.