Skip to content

syntax role modifiers - #1835

Open
jurgenvinju wants to merge 180 commits into
mainfrom
syntax-role-modifiers
Open

jurgenvinju wants to merge 180 commits into
mainfrom
syntax-role-modifiers

Conversation

@jurgenvinju

@jurgenvinju jurgenvinju commented Jul 7, 2023 •

Copy link
Copy Markdown
Member

This PR implements syntax role modifiers.

SyntaxModifiers.pdf

  • runtime types for modifiers with open and closed parameters, including subtype, lub and glb (currently working on that again, found a bug)
  • subtype lub and glb for Symbol and AType (currently working on that again, found a bug)
  • conversions for AST,Symbol and AType
  • JGenie code generator for open type modifiers
  • tests for using modifiers
  • Correct implementation of Explode: AST to separator syntax Tree conversion, using role modifiers
  • Tests for Explode
  • Fixes for deep match on separator syntax trees
  • Tests for deep match
  • Fixes for visit on separator syntax trees (not required since no bugs found)
  • Tests for visit
  • Fixes for match on separators syntax trees (impossible to discover see below)
  • Tests for match (impossible to write on this PR because external parsers are not called on concrete syntax yet)
  • Parameters that have a modifier as outermost type are translated properly to IConstructor or ITree

Note that syntax role modifiers do not introduce the fields of the modified type to the modifier type (yet). That is for another RAP/PR.

@codecov

codecov Bot commented Jul 7, 2023 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.71277% with 506 lines in your changes missing coverage. Please review.
✅ Project coverage is 45%. Comparing base (548f620) to head (25e5f9c).

Files with missing lines Patch % Lines
src/org/rascalmpl/types/ModifySyntaxRole.java 26% 209 Missing and 32 partials ⚠️
src/org/rascalmpl/ast/SyntaxRoleModifier.java 23% 87 Missing ⚠️
src/org/rascalmpl/types/NamedPlaceholder.java 24% 40 Missing and 3 partials ⚠️
src/org/rascalmpl/ast/Type.java 37% 20 Missing ⚠️
src/org/rascalmpl/library/Type.java 55% 15 Missing and 1 partial ⚠️
src/org/rascalmpl/types/RascalType.java 17% 13 Missing and 1 partial ⚠️
src/org/rascalmpl/types/RascalTypeFactory.java 45% 12 Missing and 1 partial ⚠️
...ascalmpl/semantics/dynamic/SyntaxRoleModifier.java 55% 12 Missing ⚠️
...org/rascalmpl/values/parsetrees/SymbolFactory.java 35% 10 Missing and 1 partial ⚠️
src/org/rascalmpl/ast/NullASTVisitor.java 0% 6 Missing ⚠️
... and 15 more
Additional details and impacted files
@@           Coverage Diff            @@
##              main   #1835    +/-   ##
========================================
- Coverage       45%     45%    -1%     
- Complexity    6795    6859    +64     
========================================
  Files          843     848     +5     
  Lines        68828   69582   +754     
  Branches     10030   10155   +125     
========================================
+ Hits         31381   31685   +304     
- Misses       35053   35460   +407     
- Partials      2394    2437    +43     

☔ 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.

@jurgenvinju
jurgenvinju marked this pull request as ready for review September 29, 2026 09:52
@jurgenvinju

Copy link
Copy Markdown
Member Author
  • extensions to the checker to cover all kinds of corner cases with respect to the syntax role modifeirs
  • fixes to the checker where accidentally roles would change implicitly (from data to syntax type for example)
  • bootstrapped such that the checker can check the code that uses the syntax role modifiers (like Explode)
  • fixed code examples in the stdlib where references to types were ambiguous (hidden by previous implicit conversions)

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants