Skip to content

Parser refactor #5

Merged
ninjaro merged 5 commits into
masterfrom
parser
Aug 23, 2025
Merged

Parser refactor #5
ninjaro merged 5 commits into
masterfrom
parser

Conversation

@ninjaro
Copy link
Copy Markdown
Owner

@ninjaro ninjaro commented Aug 23, 2025

No description provided.

@ninjaro ninjaro requested a review from Copilot August 23, 2025 18:03
Copy link
Copy Markdown

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 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 thread src/grouper.cpp
Comment on lines +342 to +343
} catch (const std::runtime_error& e) {
throw make_error(e.what(), result);
Copy link

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

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);

Copilot uses AI. Check for mistakes.
@ninjaro ninjaro merged commit c91a98e into master Aug 23, 2025
5 checks passed
@ninjaro ninjaro deleted the parser branch March 20, 2026 22:27
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