-
Notifications
You must be signed in to change notification settings - Fork 1
Enhance type checker and AST builder with new operator support #87
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
Conversation
…sibility parsing - Add support for division (`/`), unary negation (`-`), and bitwise NOT (`~`) operators in the AST builder. - Implement visibility parsing for functions, structs, enums, constants, and type aliases. - Update tests to cover new operator functionality and visibility checks. - Bump `tree-sitter-inference` version to 0.0.38.
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.
Pull request overview
This pull request enhances the AST builder and type checker with support for new operators and visibility parsing functionality.
Changes:
- Added support for division (
/), unary negation (-), and bitwise NOT (~) operators - Implemented visibility parsing (
pub) for definitions (functions, structs, enums, constants, type aliases) - Updated
tree-sitter-inferenceto version 0.0.38
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/src/type_checker/features.rs | Added comprehensive tests for unary negation and bitwise NOT operators on different types |
| tests/src/ast/builder.rs | Added tests for division operator, negative literals, unary operators, and visibility parsing |
| core/type-checker/src/type_info.rs | Added helper methods to check if a type is a signed integer |
| core/type-checker/src/type_checker.rs | Updated to use immutable references for expressions and added type checking for new unary operators |
| core/ast/src/nodes.rs | Added Neg and BitNot variants to UnaryOperatorKind enum |
| core/ast/src/builder.rs | Implemented visibility parsing and support for new operators in AST building |
| Cargo.toml | Bumped tree-sitter-inference version to 0.0.38 |
| CHANGELOG.md | Documented the new features and changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This commit introduces a new test module focused on various aspects of the type checker, including statement and expression coverage, type validation, function registration, generic type inference, import resolution, symbol table operations, and visibility infrastructure. The tests cover a wide range of scenarios, including edge cases and expected failures, ensuring robust validation of the type checker implementation.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Introduced a detailed error reference in `errors.md` covering 29 distinct error variants, including type mismatch, symbol resolution, visibility, function and method errors, operator errors, import errors, registration errors, and structural errors. - Provided examples, solutions, and context for each error type to aid developers in understanding and resolving issues. - Added a complete type system reference in `type-system.md`, detailing type categories, primitive types, compound types, generic types, type inference rules, operator type rules, method resolution, and visibility/access control. - Included future features and related documentation links for further exploration.
Enhance the type checker and AST builder with new operator support and visibility parsing
/), unary negation (-), and bitwise NOT (~) operators in the AST builder.tree-sitter-inferenceversion to 0.0.38.Closes #86