Skip to content

Remove %trace directive and runtime tracing functionality#60

Merged
ehwan merged 1 commit into
breaking_changefrom
remove_trace
Jun 19, 2026
Merged

Remove %trace directive and runtime tracing functionality#60
ehwan merged 1 commit into
breaking_changefrom
remove_trace

Conversation

@ehwan

@ehwan ehwan commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Description

This PR removes the %trace directive, the is_trace trait method, and the context.trace() runtime diagnostics from the parser core and generator.

Motivation

The %trace option has seen little practical utility for parsing diagnostics in standard applications. Furthermore, marking non-terminals with %trace prevents the optimization engine from applying key optimizations (such as Unit Production Elimination), resulting in larger parser tables and binary sizes. Removing %trace simplifies the codebase and allows more aggressive optimizations across all non-terminal symbols.


Key Changes

1. rusty_lr_core (Runtime)

  • Removed the is_trace method from the NonTerminal trait in nonterminal.rs.
  • Removed pub fn trace(&self) and associated helper implementations from both the deterministic (deterministic/context.rs) and nondeterministic (nondeterministic/context.rs) parser contexts.

2. rusty_lr_parser (Parser Generator)

  • Removed parsing support for the %trace directive in parser.rs and the Lexed::Trace token type in lexer.rs.
  • Removed code generation logic for the is_trace trait implementation in emit.rs.
  • Cleaned up the NonTerminalInfo struct to remove the trace field, updating all initializations in grammar.rs and pattern.rs.

3. Bootstrap & Testing

  • Regenerated parser_expanded.rs and the regression diff files (calculator.rs, calculator_u8.rs, json.rs) with the updated compiler.

4. Documentation

  • Removed references and examples of context.trace() from README.md.
  • Removed the "Tracing Non-Terminals" section and corresponding TOC entry in SYNTAX.md.

@ehwan ehwan self-assigned this Jun 19, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request removes the %trace feature and its associated functionality across the codebase. This includes removing the trace method from both deterministic and nondeterministic parser contexts, deleting the is_trace method from the NonTerminal trait, and cleaning up the parser, lexer, grammar definitions, and documentation that supported tracing non-terminals. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@ehwan ehwan changed the title take 1 Remove %trace directive and runtime tracing functionality Jun 19, 2026
@ehwan
ehwan merged commit 3ab8ce0 into breaking_change Jun 19, 2026
@ehwan
ehwan deleted the remove_trace branch June 19, 2026 10:59
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.

1 participant