Skip to content

Conversation

ydah
Copy link
Member

@ydah ydah commented Jun 14, 2025

Fixes: #182

@ydah ydah marked this pull request as ready for review June 14, 2025 14:30
Copy link

@Copilot Copilot AI left a comment

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 issue #182 by allowing terminal symbols to be used anywhere within grammar rules, not just at specific positions. The change enables more flexible grammar rule definitions where terminal symbols can appear in any part of a production rule.

  • Adds support for terminal symbols in any position within grammar rules
  • Introduces proper handling of rule continuation with OrMark symbols
  • Maintains current rule target state across rule definitions

Reviewed Changes

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

File Description
lib/racc/grammarfileparser.rb Core logic changes to track current rule target and handle rule continuations with OrMark
test/assets/term.y Test grammar file demonstrating terminal symbols used in various positions
test/regress/term Generated parser output from the test grammar
test/test_racc_command.rb New test case to verify the terminal symbol functionality

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

Comment on lines +7 to +8
| :TERM2
{ p 'term:TERM2'}
Copy link
Preview

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

Missing space before the closing brace in the action block. Should be { p 'term:TERM2' } to maintain consistency with other action blocks in the file.

Suggested change
| :TERM2
{ p 'term:TERM2'}
{ p 'term:TERM2' }

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.

Terminal can only be in first term
1 participant