Skip to content

fixed can_feed() logic#28

Merged
ehwan merged 3 commits into
mainfrom
can_feed
Sep 7, 2025
Merged

fixed can_feed() logic#28
ehwan merged 3 commits into
mainfrom
can_feed

Conversation

@ehwan

@ehwan ehwan commented Sep 7, 2025

Copy link
Copy Markdown
Owner

No description provided.

@ehwan
ehwan requested a review from Copilot September 7, 2025 07:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the can_feed() logic by refactoring the implementation to handle stack operations more accurately. The changes improve the parser's ability to determine whether it can accept a given terminal symbol by properly managing state and precedence stacks during lookahead operations.

Key changes include:

  • Refactored can_feed_impl to use separate extra stacks instead of cloning existing stacks
  • Added proper handling of reduce operations in nondeterministic parsing with multiple reduction paths
  • Improved stack length tracking and precedence calculation logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
rusty_lr_core/src/parser/nondeterministic/context.rs Major refactoring of can_feed_impl to handle multiple reduce paths and use extra stacks for simulation
rusty_lr_core/src/parser/deterministic/context.rs Updated can_feed_impl to use extra stacks and improved stack length tracking

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread rusty_lr_core/src/parser/nondeterministic/context.rs Outdated
Comment thread rusty_lr_core/src/parser/nondeterministic/context.rs Outdated
Comment thread rusty_lr_core/src/parser/nondeterministic/context.rs Outdated
Comment thread rusty_lr_core/src/parser/deterministic/context.rs Outdated
@ehwan
ehwan merged commit 14892fa into main Sep 7, 2025
1 check passed
@ehwan
ehwan deleted the can_feed branch September 7, 2025 07:25
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