Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rusty_lr_parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusty_lr_parser"
version = "3.59.0"
version = "3.59.1"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "grammar line parser for rusty_lr"
Expand Down
4 changes: 2 additions & 2 deletions rusty_lr_parser/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ impl Grammar {
let mut stack_append_stream = TokenStream::new();
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.
};
let mut split_off_split_stream = TokenStream::new();
let mut split_off_ctor_stream = TokenStream::new();
Expand Down Expand Up @@ -1751,8 +1751,8 @@ impl Grammar {
#[allow(unused_braces, unused_parens, non_snake_case, non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum #tag_enum_name {
#empty_tag_name,
#tag_definition_stream
#empty_tag_name,
}

/// enum for each non-terminal and terminal symbol, that actually hold data
Expand Down
8 changes: 4 additions & 4 deletions rusty_lr_parser/src/parser/parser_expanded.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// This file was generated by rustylr 1.22.0
// This generated code is targeting rusty_lr version 3.29.0.
// This file was generated by rustylr 1.23.0
// This generated code is targeting rusty_lr version 3.30.0.
// There might be a build error if the version is not matched.
//
// ================================User Codes Begin================================
Expand Down Expand Up @@ -431,7 +431,6 @@ impl ::rusty_lr_core::nonterminal::NonTerminal for GrammarNonTerminals {
#[allow(unused_braces, unused_parens, non_snake_case, non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum GrammarTags {
Empty,
__terminals,
__stack2,
__stack3,
Expand All @@ -452,6 +451,7 @@ pub enum GrammarTags {
__stack18,
__stack19,
__stack20,
Empty,
}
/// enum for each non-terminal and terminal symbol, that actually hold data
#[allow(unused_braces, unused_parens, non_snake_case, non_camel_case_types)]
Expand Down Expand Up @@ -4987,7 +4987,7 @@ impl ::rusty_lr_core::parser::data_stack::DataStack for GrammarDataStack {
}
fn split_off(&mut self, at: usize) -> Self {
let __other_tag_stack = self.__tags.split_off(at);
let mut __counts: [u8; 20usize] = [0; 20usize];
let mut __counts: [u8; 20usize + 1] = [0; 20usize + 1];
for &tag in &__other_tag_stack {
__counts[tag as usize] += 1;
}
Expand Down