Skip to content

Feat/rnc content-position annotations and non-leading start - #32

Merged
HassanAkbar merged 4 commits into
mainfrom
feat/rnc-content-position-annotations
Jul 22, 2026
Merged

Feat/rnc content-position annotations and non-leading start#32
HassanAkbar merged 4 commits into
mainfrom
feat/rnc-content-position-annotations

Conversation

@HassanAkbar

Copy link
Copy Markdown
Member

Summary

  • Parse bracket annotations in content positions without corrupting the tree
  • Emit a real <start> for non-leading start = definitions
  • Support combining starts: |= → choice, &= → interleave
  • Keep an escaped \start as a regular define
  • Require a comma between patterns in a sequence

Copilot AI left a comment

Copy link
Copy Markdown

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 improves RELAX NG Compact (RNC) parsing and RNG XML emission around two tricky edge cases: bracket annotations that appear in “content positions” and start definitions that appear after other grammar items (including |=/&= combining starts).

Changes:

  • Extend the RNC parser to skip bracket annotations before content items / definitions without capturing them into the parse tree, and tighten top-level sequence parsing to require commas.
  • Update the RNC→RNG converter to emit a real <start> element for non-leading start = / start |= / start &= definitions (and preserve escaped \start as a normal <define>).
  • Add advanced specs covering content-position annotations, non-leading start, combining starts, and escaped \start.

Reviewed changes

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

File Description
spec/rng/advanced_rnc_spec.rb Adds regression/feature specs for annotation-skipping and non-leading/combining start handling.
lib/rng/rnc_to_rng_converter.rb Refactors start emission and adds detection/emission for non-leading start definitions.
lib/rng/rnc_parser.rb Adds annotation_skip and uses it to drop content-position annotations; requires commas for top-level sequence items in pattern_list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/rng/rnc_to_rng_converter.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread lib/rng/rnc_parser.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread lib/rng/rnc_parser.rb
@HassanAkbar
HassanAkbar merged commit faedb8c into main Jul 22, 2026
14 checks passed
@HassanAkbar
HassanAkbar deleted the feat/rnc-content-position-annotations branch July 22, 2026 14:45
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