Skip to content

fix: parse elliptical arc flags without separators - #35

Merged
nikku merged 1 commit into
mainfrom
nikku-simplify-arc-flag-parsing
Sep 21, 2026
Merged

nikku merged 1 commit into
mainfrom
nikku-simplify-arc-flag-parsing

Conversation

@nikku

@nikku nikku commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

Closes #21

Parses elliptical arc flags without separators (A 5 5 0 10 10 10 ≡ A 5 5 0 1 0 10 10, per the SVG path BNF) using a single seven-group regex (arcValues) in the style of the existing pathValues pattern. One regex match yields one complete 7-parameter arc segment; numbers match greedily, mirroring reference SVG parsers (covered by a test).

Simpler alternative to #34, which it would supersede: same fix and tests in ~25 lines instead of a ~100-line hand-rolled parser.

Try out via npm install && npm test.

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

@nikku
nikku requested review from a team and a lite review from Copilot September 21, 2026 16:57
@bpmn-io-tasks bpmn-io-tasks Bot added the needs review Review pending label Sep 21, 2026

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.

Copilot review overview

🟡 Changes recommended

Arc parsing regresses valid uppercase scientific notation because the new regex is not case-insensitive.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates SVG arc parsing to accept adjacent arc flags while preserving repeated arc segments.

Changes:

  • Added dedicated arc parameter regex parsing.
  • Added parsing and intersection regression tests.
  • Documented the fix in the changelog.
File Description
intersect.js Implements arc-specific parameter parsing.
test/​intersect.spec.js Covers compact arc flags and intersections.
CHANGELOG.md Records the fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread intersect.js Resolved
@nikku
nikku force-pushed the nikku-simplify-arc-flag-parsing branch from be218b4 to 7efbc51 Compare September 21, 2026 20:38
Arc flags are single digits that, per the SVG path BNF, may directly
adjoin the preceding number, each other, or the following coordinate
(`A 5 5 0 10 10 10` ≡ `A 5 5 0 1 0 10 10`). Parse arc parameters
with a dedicated seven-group regex in the existing pathValues style;
numbers match greedily (atomically), mirroring reference SVG parsers.

Closes #21

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nikku
nikku force-pushed the nikku-simplify-arc-flag-parsing branch from 7efbc51 to a167eb9 Compare September 21, 2026 20:39
@nikku
nikku requested a lite review from Copilot September 21, 2026 20:56

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.

Copilot review overview

🟢 Approval recommended

The parser change is focused, covered by relevant regression tests, and no unresolved issues were found.

Review effort: Lite
Findings: None

Resolved since last review (1)

@nikku
nikku merged commit ed59e44 into main Sep 21, 2026
5 checks passed
@bpmn-io-tasks bpmn-io-tasks Bot removed the needs review Review pending label Sep 21, 2026
@nikku
nikku deleted the nikku-simplify-arc-flag-parsing branch September 21, 2026 21:00
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.

parsePathString does not fully implement arc BNF

2 participants