Skip to content

Refactor template generation code out of the KIDL parser #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged

Conversation

MrCreosote
Copy link
Member

Doesn't belong there - the KIDL parser should parse KIDL and nothing more. The template generation code has been moved into a KIDL Visitor class in the same package as the TemplateBasedGenerator.

The code is mostly C&P other than changes to allow for the fact the code no longer has access to instance variables and use the visitor pattern where possible (which isn't much w/o making drastic changes).

Tested by generating the template structure with the code in the visitor and the code in the forTemplates methods before deleting said methods, and throwing an exception if they weren't equals().

Doesn't belong there - the KIDL parser should parse KIDL and nothing
more. The template generation code has been moved into a KIDL Visitor
class in the same package as the `TemplateBasedGenerator`.

The code is mostly C&P other than changes to allow for the fact the code
no longer has access to instance variables and use the visitor pattern
where possible (which isn't much w/o making drastic changes).

Tested by generating the template structure with the code in the visitor
and the code in the `forTemplates` methods before deleting said methods,
and throwing an exception if they weren't `equals()`.
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 92.01278% with 25 lines in your changes missing coverage. Please review.

Project coverage is 65.51%. Comparing base (63072e8) to head (0fa7b2a).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...c/java/us/kbase/mobu/compiler/TemplateVisitor.java 93.11% 9 Missing and 10 partials ⚠️
...us/kbase/mobu/compiler/TemplateBasedGenerator.java 83.78% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #62      +/-   ##
============================================
+ Coverage     65.43%   65.51%   +0.07%     
- Complexity     1401     1410       +9     
============================================
  Files            77       78       +1     
  Lines          6940     6953      +13     
  Branches       1283     1284       +1     
============================================
+ Hits           4541     4555      +14     
+ Misses         1921     1920       -1     
  Partials        478      478              

☔ View full report in Codecov by Sentry.
📢 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.

@MrCreosote MrCreosote merged commit f136211 into main Mar 25, 2025
11 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.

2 participants