Skip to content

fix: reword {{cite:id}} / {{fig:id}} in lutaml definitions to unbreak make CI#59

Merged
ronaldtse merged 1 commit into
mainfrom
fix/lutaml-definition-brace-parsing
Jun 18, 2026
Merged

fix: reword {{cite:id}} / {{fig:id}} in lutaml definitions to unbreak make CI#59
ronaldtse merged 1 commit into
mainfrom
fix/lutaml-definition-brace-parsing

Conversation

@ronaldtse

Copy link
Copy Markdown
Member

Summary

The make workflow has been failing on every commit since 0a13f26 (2026-06-11, 16+ commits back) because the lutaml 0.10.x DSL parser's definition_body rule stops at the first } character. When a definition { ... } block contained {{cite:id}} or {{fig:id}} (the inline mention syntax), the parser truncated the definition at the first } and failed to match the rest.

Five occurrences across three files reworded to the bare mention form (cite:id, fig:id) — preserves semantic meaning without parser-hostile braces:

  • models/concepts/ConceptSource.lutaml — 3 occurrences (introduced by 0a13f26)
  • models/concepts/SharedNonVerbalEntity.lutaml — 1 occurrence (introduced by 300b7c1)
  • models/concepts/BibliographyEntry.lutaml — 1 occurrence (introduced by 300b7c1)

Regenerated the four tracked PNGs against lutaml 0.10.18.

Root cause

# lutaml-0.10.x/lib/lutaml/uml/parsers/dsl.rb:301
rule(:definition_body) do
  spaces? >>
    str("definition") >>
    whitespace? >>
    str("{") >>
    ((str("\\") >> any) | (str("}").absent? >> any))   # <-- stops at first "}"
      .repeat.maybe.as(:definition) >>
    str("}")
end

The body character class consumes anything that isn't }, so {{cite:id}} ends the body at the first } of the }} pair, leaving a stray } that breaks the surrounding class_body parse.

Test plan

  • lutaml lml generate -t png -o /tmp/x.png views/ConceptSource.lutaml — succeeds
  • All four view files (ConceptSource, Concepts, Designations, ManagedConcepts) generate
  • make — all 4 PNGs regenerate cleanly
  • CI green on this PR

The lutaml 0.10.x DSL parser's definition_body rule consumes any
character that is not "}", then expects a closing "}". When a
definition body contained "{{cite:id}}" or "{{fig:id}}" (the inline
mention syntax), the parser stopped at the first "}", produced a
truncated definition, then failed to match the rest.

This broke the `make` CI workflow on every commit since 0a13f26
(2026-06-11) — `images/*.png` regeneration failed on all four view
files (Concepts, ConceptSource, Designations, ManagedConcepts).

Five occurrences across three files reworded to the bare mention
form (cite:id, fig:id) — preserves semantic meaning without the
parser-hostile braces:

- models/concepts/ConceptSource.lutaml: 3 occurrences (3 lines)
- models/concepts/SharedNonVerbalEntity.lutaml: 1 occurrence
- models/concepts/BibliographyEntry.lutaml: 1 occurrence

Regenerated the four committed PNGs against lutaml 0.10.18.
@ronaldtse ronaldtse merged commit 69b8886 into main Jun 18, 2026
8 checks passed
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