Skip to content

Fix start&top implementation in typechecker - #2551

Open
DavyLandman wants to merge 11 commits into
mainfrom
fix/start-symbol-issue-2496
Open

DavyLandman wants to merge 11 commits into
mainfrom
fix/start-symbol-issue-2496

Conversation

@DavyLandman

@DavyLandman DavyLandman commented Dec 3, 2025 •

Copy link
Copy Markdown
Member

This PR continues the work in #2499 (that was merged to main a bit too soon) to fix #2496

  • removes subtype relation between start[X] and X (in asubtype, alub, aglb)
  • removes subtype relation between start symbols and regular symbols (lists)
  • removes special cases for field selection and field update on .top
  • removes special cases for \start non-terminal whereever the contextFreeSyntax role is expected by adding a role field to the start AType
  • adds an implicit/automatic declaration, for every syntax rule for X that has a start modifier:
    • start production rule start[X] = X;
    • top field start[X] = X top;
    • layout wrapping start[X] = L X L;
  • removes more special cases in the back-end
  • removes missed special cases in the collector for pattern matching
  • removed API functions isStart* and getStart* that were used for detecting the old special cases

Together these changes solve a small number of known issues with start symbols, and a larger number of previously undetected issues.

@codecov

codecov Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45%. Comparing base (ce84e35) to head (cf5b275).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2551   +/-   ##
=======================================
  Coverage       45%     45%           
- Complexity    6806    6810    +4     
=======================================
  Files          844     844           
  Lines        68826   68826           
  Branches     10040   10040           
=======================================
+ Hits         31420   31422    +2     
+ Misses       35015   35008    -7     
- Partials      2391    2396    +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

sonarqubecloud Bot commented Feb 6, 2026

Copy link
Copy Markdown

@jurgenvinju jurgenvinju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Needs an integration test.

@jurgenvinju jurgenvinju self-assigned this Apr 7, 2026
@jurgenvinju jurgenvinju added the bug label Apr 7, 2026
@jurgenvinju
jurgenvinju requested a review from PaulKlint April 17, 2026 08:22
@jurgenvinju
jurgenvinju marked this pull request as ready for review April 17, 2026 08:22
@sonarqubecloud

Copy link
Copy Markdown

@DavyLandman

Copy link
Copy Markdown
Member Author

@jurgenvinju this is your own code ;) I merely did some git cooking to extract it from a different PR.

@jurgenvinju

Copy link
Copy Markdown
Member

@PaulKlint should we use typepal's "predefine" functionality instead of constructing an artificial field location for "top"?

Same for the entire start rule. Should we use predefine for that as well?

@DavyLandman
DavyLandman force-pushed the fix/start-symbol-issue-2496 branch 2 times, most recently from 70579b4 to 1a8c413 Compare June 26, 2026 12:02
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tree of start[A] declared as A

2 participants