Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the parser to improve expression handling and adds support for implicit call expressions. The changes restructure the number parsing logic, enhance error handling with better context information, and introduce new AST node types for more complex call patterns.
- Refactored number parsing into smaller, more focused helper methods
- Added support for implicit call expressions (
main(a)(b)style syntax) - Enhanced error handling with source location tracking and better context messages
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/identify_tests.cpp | Added comprehensive tests for implicit calls, complex expressions, and control flow parsing |
| tests/arithmetic_tests.cpp | Updated variable declarations to use const auto for immutable parsed results |
| src/reader.cpp | Refactored number parsing into separate helper methods for better maintainability |
| src/grouper.cpp | Major restructuring of parsing logic with new helper methods and implicit call support |
| src/expression.cpp | Enhanced error handling with source location information and better error messages |
| src/ast.cpp | Added new imcallexp_node class for handling implicit call expressions |
| readme.md | Moved detailed syntax guide to separate documentation file |
| include/reader.hpp | Added declarations for new number parsing helper methods |
| include/grouper.hpp | Added declarations for new parsing helper methods |
| include/expression.hpp | Added error handling method with source location support |
| include/ast.hpp | Added declaration for new imcallexp_node class |
| data/test08.qc | Added test case for chained function calls |
| data/test07.qc | Added test case for list expressions |
| data/readme.md | New comprehensive syntax guide documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Comment on lines
+342
to
+343
| } catch (const std::runtime_error& e) { | ||
| throw make_error(e.what(), result); |
There was a problem hiding this comment.
The make_error function expects a std::vector<item> as the second parameter, but result is a group_ptr. This will cause a compilation error.
Suggested change
| } catch (const std::runtime_error& e) { | |
| throw make_error(e.what(), result); | |
| throw make_error(e.what(), result->nodes); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.