Skip to content

fixed number of tags mismatch in split_off#24

Merged
ehwan merged 1 commit into
mainfrom
error
Aug 20, 2025
Merged

fixed number of tags mismatch in split_off#24
ehwan merged 1 commit into
mainfrom
error

Conversation

@ehwan

@ehwan ehwan commented Aug 20, 2025

Copy link
Copy Markdown
Owner

No description provided.

@ehwan
ehwan requested a review from Copilot August 20, 2025 14:06
@ehwan
ehwan merged commit 1553be1 into main Aug 20, 2025
1 check passed
@ehwan
ehwan deleted the error branch August 20, 2025 14:06

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 a bug where the number of tags in the split_off method didn't match the actual number of enum variants in the GrammarTags enum. The fix involves moving the Empty tag to the end of the enum and adjusting the array size accordingly.

  • Relocated the Empty tag from first to last position in the GrammarTags enum
  • Updated array size calculation in split_off method to account for all enum variants
  • Bumped version number to reflect the bug fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
rusty_lr_parser/src/parser/parser_expanded.rs Generated code with moved Empty tag and corrected array size
rusty_lr_parser/src/emit.rs Template code that generates the parser with the tag reordering and array size fix
rusty_lr_parser/Cargo.toml Version bump to 3.59.1

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

let stack_len = stack_names_in_order.len();
let split_off_count_init_stream = quote! {
let mut __counts: [u8; #stack_len] = [0; #stack_len];
let mut __counts: [u8; #stack_len+1] = [0; #stack_len+1];

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

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

The expression #stack_len+1 should use parentheses for clarity: #(#stack_len + 1) to make the operator precedence explicit in the macro expansion.

Suggested change
let mut __counts: [u8; #stack_len+1] = [0; #stack_len+1];
let mut __counts: [u8; #(stack_len + 1)] = [0; #(stack_len + 1)];

Copilot uses AI. Check for mistakes.
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