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

Inject template name as a comment in generated code #1186

Open
TimLethbridge opened this Issue Dec 18, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@TimLethbridge
Member

TimLethbridge commented Dec 18, 2017

Inject the name of each code generation template in UmpleToX/UmpleTlTemplates to not only into the code compiled from the template (as is presently the case), but also into the code generated and presented to the user.

To help understand, there are two invocations of the compiler.

  1. Compile the compiler (including templates) to produce a new compiler. Templates names appear.
  2. Compile the user's code with the new compiler. Template names do not appear (except in one case below). This needs fixing.

This will greatly help debugging and allow people to better understand how code generation occurs.

The fix for issue #1160 changed template file association_AddManyToOne.ump from having first line

    association_AddManyToOne <<!<</*association_AddManyToOne*/>>

to the first two lines being being

  association_AddManyToOne <<!  /* Code from template association_AddManyToOne */
<</*association_AddManyToOne*/>>

TimLethbridge added a commit that referenced this issue Jan 27, 2018

Merge pull request #1209 from umple/Refactor1GenTemplates
Refactoring many templates so their name appears in generated code. Contributes to #1186
@TimLethbridge

This comment has been minimized.

Show comment
Hide comment
@TimLethbridge

TimLethbridge Feb 3, 2018

Member

This is done since PR 1211 in all templates that don't break tests. Some tests have not been using asserts that is sensitive to the extra comment. None of the state machine templates have yet been instrumented.

Member

TimLethbridge commented Feb 3, 2018

This is done since PR 1211 in all templates that don't break tests. Some tests have not been using asserts that is sensitive to the extra comment. None of the state machine templates have yet been instrumented.

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