Skip to content

fixed expected() logic#29

Merged
ehwan merged 2 commits into
mainfrom
expected
Sep 7, 2025
Merged

fixed expected() logic#29
ehwan merged 2 commits into
mainfrom
expected

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 13:00

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 logic in the expected() method for both deterministic and nondeterministic parser contexts. The fix addresses how the parser handles state stack operations when determining expected tokens.

  • Refactored expected_token_impl to use a separate extra_state_stack instead of modifying the original state stack
  • Updated parameter handling to properly track stack lengths and node positions
  • Implemented recursive token expectation logic that correctly handles reduce operations

Reviewed Changes

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

File Description
rusty_lr_core/src/parser/nondeterministic/context.rs Updated expected token implementation to use node-based stack tracking with proper reduce operation handling
rusty_lr_core/src/parser/deterministic/context.rs Refactored to use separate extra state stack and stack length tracking for cleaner state management

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

@ehwan
ehwan merged commit 0f8d2dc into main Sep 7, 2025
1 check passed
@ehwan
ehwan deleted the expected branch September 7, 2025 13:01
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